tp5 rewrite nginx 配置
2024-09-03 23:59:40
今天弄了个别人的项目,用的tp5,正好前段时间学tp5了,可是人家竟然用了rewrite,我没学过啊,放在nginx ,全是404,真尴尬
其实很简单,在配置文件里面添加一小段代码就ok了
时间紧张直接把配置文件放出来
server {
listen ;
server_name test.wqzsub.com;
location / {
root /var/www/test;
index index.php index.html index.htm;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
/*主要加了这一块*/
} location ~ \.php$ {
root /var/www/test;
fastcgi_pass unix:/run/php/php7.-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
最新文章
- linux中rz中的-e选项
- ASP.NET MVC Layout 嵌套
- python 安装pillow
- java导出excel表格
- 常用汉字的Unicode码表
- spring-cloud-feign案例
- SharePoint 2013 入门教程--系列文章
- Jquery+asp.net后台数据传到前台js进行解析的方法
- 安装Intel HAXM为Android 模拟器加速,30秒内启动完成
- 【转】TI-Davinci开发系列之六CCS5.2调试Linux内核
- java程序获得SqlServer数据表的表结构
- 文字超出DIV后,隐藏文字并显示...
- PCMM(人力资源能力成熟度模型)V2.0中英对照版发布
- cocos2dx-lua中handler解析
- 十二、针对单个工程来配置jdk版本
- shell脚本学习-练习写一个脚本2
- 【排列组合】ZSC1076: 数学、不容易系列之三——考新郎
- 用注册表禁止windows添加新用户
- Jenkins 学习笔记(一)
- SuSE 网卡配置模板