How do I turn on pathinfo for nginx in an lnmp environment
- 2020-05-07 20:57:27
- OfStack
If you are in a development environment installed with the lnmp script 1 key, you can account for pathinfo by:
1. Comment try_files in nginx.conf (because it is the same as pathinfo.conf), turn on the pathinfo.conf configuration:
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;
}
Comment out line 4 and open line 8.
2. Restart nginx service:
nginx -s reload