lnmp enables pathinfo and hides index.php, lnmppathinfo
Edit the following section:
location ~ [^/]\.php(/|$)
{
# comment try_files $uri =404; to enable pathinfo
try_files $uri =404;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
#include pathinfo.conf;
}
Copy after login
Line 1 is changed to:
location ~ [^/]\.php
Copy after login
Line 4 Comment out the line, that is, add # in front of it
#try_files $uri =404;
Copy after login
Remove the comment on line 8
include pathinfo.conf;
Copy after login
Add a section above location ~ [^/].php
location /
{
if (!-e $request_filename)
{
rewrite "^/(.*)$" /index.php last;
}
}
Copy after login
Restart Nginx
service nginx restart
Copy after login
http://www.bkjia.com/PHPjc/1063025.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1063025.htmlTechArticlelnmp enables pathinfo and hides index.php, lnmppathinfo edits the following section: location ~ [^/].php( /|$){ # comment try_files $uri =404; to enable pathinfo try_files $uri =404; fastcgi_pa...