解决 ci yii 下nginx 404 错误
来源:互联网 发布:淘宝小号 不实名 购买 编辑:程序博客网 时间:2024/05/24 05:50
location ~ \.php { # 这里减掉一个“$”原本是\.php$
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php; # 这一句不知道什么用处
fastcgi_split_path_info ^(.+\.php)(.*)$; # 加了这一句
fastcgi_param PATH_INFO $fastcgi_path_info; # 还有这一句
include fastcgi.conf;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php; # 这一句不知道什么用处
fastcgi_split_path_info ^(.+\.php)(.*)$; # 加了这一句
fastcgi_param PATH_INFO $fastcgi_path_info; # 还有这一句
include fastcgi.conf;
}
yii----------------------------------------------
location ~ \.php { # ......<93>$<94>...\.php$
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php; # ..........
fastcgi_split_path_info ^(.+\.php)(.*)$; # ....
# fastcgi_param PATH_INFO $fastcgi_path_info; # .....
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php; # ..........
fastcgi_split_path_info ^(.+\.php)(.*)$; # ....
# fastcgi_param PATH_INFO $fastcgi_path_info; # .....
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
---------------------------------------------
nginx 配置
server {
listen 8080;
server_name 192.168.1.168;
root html/e3m;
location / {
root html/e3m;
index index.html index.php;
if ($request_filename !~ (connect|gif|png|jpg|js|css|images|source|robots/.txt|index/.php.*) ) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
location ~* .(jpg|jpeg|gif|png|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 360d;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php { # ......<93>$<94>...\.php$
root html/e3m;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php; # ..........
fastcgi_split_path_info ^(.+\.php)(.*)$; # ....
# fastcgi_param PATH_INFO $fastcgi_path_info; # .....
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
}
listen 8080;
server_name 192.168.1.168;
root html/e3m;
location / {
root html/e3m;
index index.html index.php;
if ($request_filename !~ (connect|gif|png|jpg|js|css|images|source|robots/.txt|index/.php.*) ) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
location ~* .(jpg|jpeg|gif|png|css|js|ico|xml)$ {
access_log off;
log_not_found off;
expires 360d;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location ~ \.php { # ......<93>$<94>...\.php$
root html/e3m;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php; # ..........
fastcgi_split_path_info ^(.+\.php)(.*)$; # ....
# fastcgi_param PATH_INFO $fastcgi_path_info; # .....
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
}
最后执行
/usr/local/nginx/sbin/nginx -s reload
就完事儿了
- 解决 ci yii 下nginx 404 错误
- Nginx+CI 出现404错误
- Nginx+CI 出现404错误
- Nginx+CI出现404错误
- CI框架下nginx重写规则,不再404
- 解决nginx服务下 thinkphp只能访问首页不报任何错误的问题404错误
- 【Nginx】Nginx下的Yii部署
- Ubunt nginx下配置CI框架
- CI框架部署到nginx环境中后,报404错误(解决方法)
- Yii自定义错误页面(403,404)和NGINX 配置404错误页面转向
- ci、tp、yii优缺点
- wordpress 在nginx服务器下重写路由,解决设置固定链接后出现404错误
- nginx下面wordpress 路由404错误解决!
- 解决Nginx 500错误
- Nginx错误解决小结
- Yii在Nginx下的rewrite配置
- nginx下yii伪静态处理
- Yii在Nginx下的rewrite配置
- ognl
- 面试题15 - 查找最小的 k 个元素 [数组] / (堆优化 STL O(nlogk) )[STL]
- Linux下显示加载动态库注意事项
- Win7 64位下注入工具
- HDU 2009 求数列的和
- 解决 ci yii 下nginx 404 错误
- 机房收费系统画图—用例图、类图
- 机房收费系统技术盘点--正则表达式
- [baidu] 面向对象的三个基本要素和五项基本设计原则
- 解决FlashPaper转PDF出现旋转问题的方法
- 编成技术6
- poj1019 很好的一道数学题 思路挺巧
- 寿星天文历Java版源码
- jQuery 在Iframe父窗口中查找对象