CodeIgniter 用的是path_info的url模式,但nginx需要修改下配置才能支持,
以下内容来自网页的分享,不是原创:
解决方法:修改nginx配置文件。在server层里修改一下内容
location ~ .*\.(php|php5)
#有的是location ~ \.php$,有的是location ~ .*\.(php|php5)?$。根据具体情况而定,去掉?和$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
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;
}
内容来源:https://blog.csdn.net/xuchuang_1010/article/details/84437152