junlytang 发表于 2012-2-24 15:00:04

CodeIgniter在nginx下404 not found

CodeIgniter移动到linux+nginx+php5.3.6
上页面访问报404 not found.
之前放在window下用的apache+php5.3.2环境都是能够正常的。谁能救救我呀~~~
小妹感激不尽~~

vergil 发表于 2012-2-24 15:09:57

我也遇到同样的问题了

sdink 发表于 2012-2-24 16:02:20

nginx设置有问题

vergil 发表于 2012-2-24 16:04:03

什么问题,如何解决?

sdink 发表于 2012-2-24 16:05:44

还有在论坛里搜索nginx 404 你就知道怎么搞了

junlytang 发表于 2012-2-24 16:21:14

还是木有解决,现在是报502我那个神啊~请高手仔细指点~~

sdink 发表于 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_namewww.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_paramSCRIPT_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;
}
页: [1] 2
查看完整版本: CodeIgniter在nginx下404 not found