服务器好久不用,突然所有的链接全都路由到首页了,观察发现(),CI路由到了 ../modules/home/controllers/里,朋友提示我可能是nginx配置的问题。
参照:
里面说明,
```
location ~^(.+\.php)(.*)$ {
root D:/www/Codeigniter_2.0.1/;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_pass 127.0.0.1:9002;
include fastcgi_params;
}
```
在原文中增加了
```
fastcgi_split_path_info ^(.+\.php)(.*)$;
```
后来发现 PATH_INFO 和 PATH_TRANSLATED 会导致系统变慢,于是去掉这两行,没有任何影响。
最终的配置:
```
location ~ .+\.php.*$ {
root /root/www;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass 127.0.0.1:9000;
include fastcgi_params;
}
```
阅读(662) | 评论(0) | 转发(0) |