一个域名配置文件中 不能出现两个 location /
[ Nginx ]
在Nginx低版本中,是不支持PATHINFO的,但是可以通过在Nginx.conf中配置转发规则实现:
location / { // …..省略部分代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
本文介绍在Nginx低版本中如何通过配置转发规则来支持PATHINFO,避免在同一域名配置文件中出现两个location/的问题。
在Nginx低版本中,是不支持PATHINFO的,但是可以通过在Nginx.conf中配置转发规则实现:
location / { // …..省略部分代码
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
}
}
1313

被折叠的 条评论
为什么被折叠?