server
重定向
location ~* ^/.*$
{
rewrite ^/(.*) /index.php?$1 last;
break;
}
转发
location ~* ^/test/.*$ {
proxy_pass http://test-group.web.cn;
expires off;
}
本文详细解析了Nginx中的重定向与转发配置规则,包括使用正则表达式进行路径匹配,以及如何将请求重写到特定文件或转发到另一服务器。对于理解Nginx的rewrite模块及proxy_pass指令有深入指导。
server
重定向
location ~* ^/.*$
{
rewrite ^/(.*) /index.php?$1 last;
break;
}
转发
location ~* ^/test/.*$ {
proxy_pass http://test-group.web.cn;
expires off;
}
1424
2973
4593

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