简单配置nginx使之支持pathinfo
2016-01-05 16:54
459 查看
原文地址:http://www.thinkphp.cn/topic/3228.html
只需要修改3个地方就可以了,亲测成功,看代码有注解
vi
/etc/nginx/nginx.conf
location ~ \.php { #去掉$
root H:/PHPServer/WWW;
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_params;
}
重启nginx php-fpm
service
nginx restart
service
php-fpm restart
只需要修改3个地方就可以了,亲测成功,看代码有注解
vi
/etc/nginx/nginx.conf
location ~ \.php { #去掉$
root H:/PHPServer/WWW;
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_params;
}
重启nginx php-fpm
service
nginx restart
service
php-fpm restart
相关文章推荐
- 一个关于if else容易迷惑的问题
- nginx代理指定目录
- PHP5.2.*防止Hash冲突拒绝服务攻击的Patch
- 深入理解PHP之匿名函数
- 访问Nginx发生SSL connection error的一种情况
- JSP/PHP基于Ajax的分页功能实现
- 关于PHP通过PDO用中文条件查询MySQL的问题。
- Nginx+Naxsi部署专业级Web应用防火墙
- 什么是设计模式
- CentOS 6.2实战部署Nginx+MySQL+PHP
- PHP数据库长连接mysql_pconnect的细节
- nginx中http核心模块的配置指令2
- nginx中http核心模块的配置指令3
- nginx中http核心模块的配置指令4
- nginx中http的fastcgi模块的配置指令1
- kindeditor 批量上传 上传失败 thinkphp swfupload session
- Php Installing An Expansion
- Nginx 学习笔记(一)