nginx 支持pathinfo
错误描述:1,打开网页,页面提示不支持pathinfo
2,类似index.php/hellworld会提示找不到页面
解决办法:1,修改nginx.conf的server{}中的内容下:
75#passthePHPscriptstoFastCGIserverlisteningon127.0.0.1:9000
76#
77location~\.php{
78roothtml;
79fastcgi_pass127.0.0.1:9000;
80fastcgi_indexindex.php;
81fastcgi_paramSCRIPT_FILENAME$document_root$fastcgi_script_name;
82includefastcgi_params;
83#pathinfosupport
84set$real_script_name$fastcgi_script_name;
85set$path_info"";
86if($fastcgi_script_name~"^(.+?\.php)(/.+)$"){
87set$real_script_name$1;
88set$path_info$2;
89}
90
91fastcgi_paramSCRIPT_NAME$real_script_name;
92fastcgi_paramPATH_INFO$path_info;
93
94}
ps:红色部分为笔者改动的部分
相关推荐
nginxs 2020-11-14
Guanjs0 2020-11-13
小木兮子 2020-11-11
yserver 2020-11-11
ssihc0 2020-11-11
windle 2020-11-10
HanksWang 2020-11-10
liuchen0 2020-11-10
Freshairx 2020-11-10
ccschan 2020-11-10
liwf 2020-11-10
Guanjs0 2020-11-09
AderStep 2020-11-09
zrtlin 2020-11-09
mqfcu 2020-11-10
windle 2020-10-29