默認的lnmp沒有開啓pathinfo模式,但不少框架須要用到。php
cd /usr/local/nginx/confnginx
vim enable-php.confvim
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;#新增pathinfo模式 }
service nginx restart 框架
OKspa