vagrant本地安裝lnmp後nginx配置只能打開首頁或者出現404

nginx.conf下server模塊的配置文件如下圖紅框部分

 

複製可以直接複製以下代碼

location / {
     if (!-e $request_filename) {
       rewrite ^/index.php(.*)$ /index.php?s=$1 last;
       rewrite ^(.*)$ /index.php?s=$1 last;
       break;
     }  
     index index.html index.htm index.php l.php;
     autoindex off;
} 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章