在使用tp5时候把它部署到服务器上发现一个奇葩的事情,就是它默认访问config配置的默认页,无论怎么跳转到其他接口都不好使,最终重写了 Nginx 的配置文件解决了这个问题
server{ listen 80; server_name www.XXXX.com; index index.php index.html index.htm; root /var/www/didu; location ~ \.php #原来这个里有“$” 去掉就ok { #fastcgi_pass unix:/tmp/php-cgi.sock; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_split_path_info ^(.+\.php)(.*)$; #新加第一句 fastcgi_param PATH_INFO $fastcgi_path_info;#新加第二句 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;#新加第三句 include fastcgi.conf; } location / { try_files $uri $uri/ /index.php?$query_string; } }
以上这篇解决thinkPHP 5 nginx 部署时,只跳转首页的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持华域联盟。
您可能感兴趣的文章:
- centos6.6 下 安装 php7 + nginx环境的方法
- CentOS 8.1下搭建LEMP(Linux+Nginx+MySQL+PHP)环境(教程详解)
- Centos 安装 PHP7.4 和 Nginx的操作方法
- 浅谈thinkphp的nginx配置,以及重写隐藏index.php入口文件方法
- 详解php+nginx 服务发生500 502错误排查思路
- docker搭建php+nginx+swoole+mysql+redis环境的方法
- nginx+php出现No input file specified解决办法
- Nginx+php配置文件及原理解析
本文由 华域联盟 原创撰写:华域联盟 » 解决thinkPHP 5 nginx 部署时,只跳转首页的问题
转载请保留出处和原文链接:https://www.cnhackhy.com/65423.htm