解决thinkPHP 5 nginx 部署时,只跳转首页的问题

2020-09-04 08:02:39

在使用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;    }}
相关文章 大家在看