原网页:centos7下nginx目录反向代理不生效 侵权删除
参考文章
proxy_pass 反向代理配置中 url 后面加不加/的说明
nginx location proxy_pass 后面的url 加与不加/的区别
【问题如下】:访问反向代理 http://a.b.com/test 返回 404。
#PROXY-START/test
location /test
{
proxy_pass http://a.b.com:8000;
proxy_set_header Host a.b.com;
}
#PROXY-END/test
【解决方法】在 proxy_pass 域名后面加 test 即可解决。
#PROXY-START/test
location /test
{
proxy_pass http://a.b.com:8000/test;
proxy_set_header Host a.b.com;
}
#PROXY-END/test
虽然问题解决了,但是还是没想明白。