解决thinkPHP 5 nginx 部署时,只跳转首页的问题
作者:淋过雨的街头 时间:2024-05-11 09:22:31
在使用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;
}
}
来源:https://blog.csdn.net/qq_18353611/article/details/79428270
标签:thinkPHP5,nginx,跳转,首页
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
手把手教你MySQL运算符
2024-01-22 12:53:16
![](https://img.aspxhome.com/file/2023/3/117823_0s.jpg)
验证sql保留字工具
2008-05-15 12:34:00
使用numpy.ndarray添加元素
2022-10-31 06:12:15
python实现的分层随机抽样案例
2022-06-07 16:10:42
![](https://img.aspxhome.com/file/2023/8/115878_0s.jpg)
pytorch_detach 切断网络反传方式
2022-09-25 21:10:50
PHP getallheaders无法获取自定义头(headers)的问题
2024-04-30 08:47:30
![](https://img.aspxhome.com/file/2023/6/132796_0s.png)
MySQL数据库 Load Data 多种用法
2024-01-22 09:54:50
![](https://img.aspxhome.com/file/2023/5/119745_0s.png)
基于Python自制一个文件解压缩小工具
2021-10-15 14:28:00
十一个案例带你吃透Python函数参数
2021-07-02 08:11:12
Python 过滤错误log并导出的实例
2023-10-21 10:18:36
解决Django生产环境无法加载静态文件问题的解决
2022-03-12 18:31:09
Mysql保持现有内容在后面增加内容的sql语句
2024-01-21 07:11:01
PHP session会话操作技巧小结
2023-11-16 23:58:20
![](https://img.aspxhome.com/file/2023/1/104161_0s.jpg)
pip/anaconda修改镜像源,加快python模块安装速度的操作
2022-06-01 10:42:26
![](https://img.aspxhome.com/file/2023/2/87542_0s.jpg)
python实现按键精灵找色点击功能教程,使用pywin32和Pillow库
2023-11-08 18:30:34
![](https://img.aspxhome.com/file/2023/5/63915_0s.jpg)
Go并发编程之sync.Once使用实例详解
2024-04-26 17:21:23
Python利用watchdog模块监控文件变化
2023-10-23 22:27:22
![](https://img.aspxhome.com/file/2023/5/114615_0s.png)
SQL语句操作主从关系表
2011-06-19 13:19:05
SQL Server 数据库优化
2024-01-20 00:34:18
如何使用FSO修改文件夹的名称
2008-10-11 14:24:00