lnmp一鍵安裝包開啟pathinfo
阿新 • • 發佈:2019-01-09
lnmp一鍵安裝包開啟pathinfo
此教程適用於整合安裝包lnmp,官網是https://lnmp.org/
一、 開啟pathinfo
註釋 下面這一行
include enable-php.conf
載入新的配置檔案
include enable-php-pathinfo.conf
二、 開啟rewrite
在server最後新增如下的配置
新增如下
location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php/$1 last; break; } } location ~ /index.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/index.php; include fastcgi_params; fastcgi_param APPLICATION_ENV dev; }
三、 重啟服務
service nginx restart