CI框架Nginx重写规则
2012-07-20 09:55
423 查看
东西是参考了CU上一哥们的博文,按他的方法没成功我自己改了下,反正现在按这样配是可以重写过来了。网上有的文章说要把 “location ~ \.(php|php5)?$”后面的$去掉,但是我去掉之后url无限跳转增加.有的说要开php_info,我开了也没用
server
{
listen 80;
server_name xxxx.xxxxx.com;
root /home/wwwroot/xxxx;
location / {
index index.html index.htm index.php;
rewrite ^/(.+)$ /index.php last;
}
location ~ \.(php|php5)?$
{
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log off;
}
~
server
{
listen 80;
server_name xxxx.xxxxx.com;
root /home/wwwroot/xxxx;
location / {
index index.html index.htm index.php;
rewrite ^/(.+)$ /index.php last;
}
location ~ \.(php|php5)?$
{
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log off;
}
~
相关文章推荐
- CI 即CodeIgniter框架在Nginx下的重写规则
- CI框架下nginx重写规则,不再404
- 解析CI即CodeIgniter框架在Nginx下的重写规则
- CI框架下nginx重写规则
- nginx下利用phcalcon生成框架的重写规则
- PHP的Symfony和CodeIgniter框架的Nginx重写规则配置
- php-fpm nginx 框架重写规则
- CodeIgniter框架在Nginx下的重写规则
- 解析CI即CodeIgniter框架在Nginx下的重写规则
- nginx重写规则
- Nginx 重写规则指南
- CI框架apache和nginx环境下面统一去掉路径URL后面的index.php
- CI框架在 nginx 服务器上配置 rewrite 去掉 index.php 的方法:
- nginx重写规则隐藏index.php
- CI框架部署到nginx环境中后,报404错误(解决方法)
- ThinkPHP在nginx下重写规则配置
- CI 框架 404 跳转到自己的controller 分类: 地址传参 地址重写 php CI框架 2014-03-26 10:58 413人阅读 评论(0) 收藏
- Nginx 匹配规则与URL重写
- Laravel的Nginx重写规则实例代码
- Nginx 重写规则指南