tp3.2部署在nginx主页正常,其他页面404问题解决方式
生活随笔
收集整理的這篇文章主要介紹了
tp3.2部署在nginx主页正常,其他页面404问题解决方式
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
nginx 默認不支持pathinfo,需要重寫
在當前域名的配置文件修改加上
在 /usr/local/nginx/conf/enable-php.conf 文件修改為以下
location ~ [^/]\.php(/|$){try_files $uri =404;fastcgi_pass unix:/tmp/php-cgi.sock;fastcgi_index index.php;include fastcgi.conf;set $fastcgi_script_name2 $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+\.php)(/.+)$") { set $fastcgi_script_name2 $1; set $path_info $2; } fastcgi_param PATH_INFO $path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name2; fastcgi_param SCRIPT_NAME $fastcgi_script_name2;}重啟nginx?
nginx -s reload
轉載于:https://www.cnblogs.com/zhangxilu/p/8303967.html
總結
以上是生活随笔為你收集整理的tp3.2部署在nginx主页正常,其他页面404问题解决方式的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Kotlin 1.2 新特性
- 下一篇: 配置VRRP(虚拟路由器冗余协议)