简单配置nginx使之支持pathinfo
程序员文章站
2022-05-08 09:06:34
...
原文地址:http://www.thinkphp.cn/topic/3228.html
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$; #增加这一句
fastcgi_param PATH_INFO $fastcgi_path_info; #增加这一句
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
只需要修改3个地方就可以了,亲测成功,看代码有注解
location ~ \.php { #去掉$
root H:/PHPServer/WWW;fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$; #增加这一句
fastcgi_param PATH_INFO $fastcgi_path_info; #增加这一句
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
以上就介绍了简单配置nginx使之支持pathinfo,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。
推荐阅读