原创:修改Nginx.conf 启用PATH_INFO
之前安装typecho和magike时,出现跳转异常,最后发现nginx没有配置path_info,现在把方法保存下来。
修改:
location ~ .*\.(php|php5)? $
{
fastcgi_pass unix:/tmp/php-cgi.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
为:
location ~ .*\.(php|php5)?
{
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_pass unix:/tmp/php-cgi.sock;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fcgi.conf;
注意,一定要去掉”location ~ .*\.(php|php5)? $ ”中的$。