问题描述
服务器上安装了lanp一键安装包,配置nginx支持pathinfo访问模式时一直不成功
问题解答
回答1:新版本的nginx有一个自带的函数可以处理pathinfo,如下:
location ~ .php(.*)$ { fastcgi_pass unix:/tmp/php-cgi.sock; 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; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; #includefastcgi_params; include fcgi.conf;}回答2:
https://xuwenzhi.com/2015/04/05/nginx-%E9%85%8D%E7%BD%AE-pathinfo/
试试这个。