码迷,mamicode.com
首页 > 其他好文 > 详细

简单配置nginx使之支持pathinfo

时间:2018-04-04 20:45:53      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:pat   www   index   dex   配置nginx   修改   ast   soc   pos   

只需要修改3个地方就可以了,亲测成功,看代码有注解

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;
}

server
{
listen 80;
server_name dejinio.com;
index index.html index.htm index.php;
root /data/www/dejinio/yun;
location ~ \.php {
include fastcgi_params;
fastcgi_pass unix:/tmp/php-fcgi.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME /data/www/dejinio/yun$fastcgi_script_name;
}
}

简单配置nginx使之支持pathinfo

标签:pat   www   index   dex   配置nginx   修改   ast   soc   pos   

原文地址:https://www.cnblogs.com/linuxde/p/8718275.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!