nginx支持pathinfo模式
来源:互联网 发布:mac压感 编辑:程序博客网 时间:2024/04/28 06:07
Nginx服务器默认不支持pathinfo, 在需要pathinfo支持的程序中(如thinkphp),则无法支持”/index.php/Home/Index/index”这种网址.
网上流传的解决办法很多,这里提供一种比较简洁的写法(只需要改动2行代码)
# 典型配置location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name; include fastcgi_params;}# 修改第1,6行,支持pathinfolocation ~ \.php(.*)$ { # 正则匹配.php后的pathinfo部分 root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name; fastcgi_param PATH_INFO $1; # 把pathinfo部分赋给PATH_INFO变量 include fastcgi_params;}
0 0
- Nginx 支持pathinfo模式
- Nginx支持pathinfo模式
- nginx支持pathinfo模式
- 配置nginx支持pathinfo模式
- 配置nginx支持pathinfo模式
- nginx搭建pathinfo模式支持
- 配置nginx支持PATHINFO模式
- 配置Nginx支持pathinfo模式
- Nginx服务器支持pathinfo模式
- 设置 nginx 支持 thinkPHP 的 pathinfo 模式
- Nginx上ThinkPHP的PATHINFO模式支持
- nginx---支持php 框架 pathinfo 模式
- 设置 nginx 支持 thinkPHP 的 pathinfo 模式
- LNMP 配置NGINX 支持THINKPHP PATHINFO模式
- nginx环境支持thinkphp的pathinfo模式
- 简单配置nginx支持pathinfo模式
- 使得nginx支持pathinfo访问模式
- nginx ssl以及支持pathinfo模式,
- 2016Android某公司面试题
- 用PHP发送POST请求
- 网站正向代理服务器和反向代理服务器的区别
- Android自定义View——实现理财类APP七日年化收益折线图效果
- java对cookie的操作
- nginx支持pathinfo模式
- 将Unity地形以Wavefront Obj格式导出
- Mysql在大型网站的应用架构演变
- Linux切换到root用户失败原因
- HDU 4305 Lighting(生成树计数+点在线段判断)
- (4.6.19)Android性能分析工具整理汇总
- redis info命令中各个参数的含义
- Spring Boot示例 - 2. 使用Spring Boot + Spring Data REST + Spring Data JPA构建符合HATEOAS规范的REST应用
- 聚类