用户
 找回密码
 入住 CI 中国社区
搜索
查看: 8366|回复: 10
收起左侧

[讨论/交流] CodeIgniter在nginx下404 not found

[复制链接]
发表于 2012-2-24 15:00:04 | 显示全部楼层 |阅读模式
CodeIgniter移动到linux+nginx+php5.3.6
上页面访问报404 not found.
之前放在window下用的apache+php5.3.2环境都是能够正常的。谁能救救我呀~~~
小妹感激不尽~~
发表于 2012-2-24 15:09:57 | 显示全部楼层
我也遇到同样的问题了
发表于 2012-2-24 16:02:20 | 显示全部楼层
nginx设置有问题
发表于 2012-2-24 16:04:03 | 显示全部楼层
什么问题,如何解决?
发表于 2012-2-24 16:05:44 | 显示全部楼层
还有在论坛里搜索nginx 404 你就知道怎么搞了
 楼主| 发表于 2012-2-24 16:21:14 | 显示全部楼层
还是木有解决,现在是报502我那个神啊~请高手仔细指点~~
发表于 2012-2-24 19:55:24 | 显示全部楼层
502 你服务器有问题
发表于 2013-1-18 15:21:18 | 显示全部楼层
是因为Nginx不像apache支持pathinfo,所以只能模拟pathinfo
发表于 2013-1-18 15:22:12 | 显示全部楼层
server
02

03
{
04

05
    listen       80;
06
    server_name  www.xxx.com;
07
    index index.php;
08
    root  /www/cyrec;
09

10
    location ~ .*.php($|/)
11
    {
12
        root /www/cyrec;
13
        fastcgi_param SCRIPT_FILENAME /www/cyrec$fastcgi_script_name;
14
        fastcgi_split_path_info ^(.+\.php)(.*)$;
15
        fastcgi_param PATH_INFO $fastcgi_path_info;
16
        include fastcgi_params;
17
      fastcgi_pass unix:/tmp/php-fcgi.sock;
18
      fastcgi_index index.php;
19
    }
20

21
重启nginx /usr/local/etc/rc.d/nginx reload,解决问题

发表于 2013-1-18 15:22:29 | 显示全部楼层
location ~ /index.php/ {  
     fastcgi_param  SCRIPT_FILENAME  /path/to/your/index.php;  
     fastcgi_index index.php;  
     fastcgi_pass 127.0.0.1:9000;  
     include fastcgi_params;  
     # 你也可以写到fastcgi_params文件中  
     fastcgi_param PATH_INFO $fastcgi_script_name;  
}  

本版积分规则