proxy_pass 端口后紧跟 /
proxy_pass有/👆👆
location只属于部分匹配, 不属于请求部分, 会在请求路径中删除
- 代理路径 =>替换=> 监听路径 :
http://localhost:23323//api/server/user- 删除location路径:
http://localhost:23323/server/user(P1)http://localhost:23323//server/user(P2)
proxy_pass 端口后不跟 /
proxy_pass无/👆👆
location不管带不带/都会将
/api都添加至proxy_pass路径后, 并作为真实请求路径
proxy_pass 后还有路径
与第一种情况一致👆👆
代理路径 替换 监听路径 :
http://localhost:23323/route//api/demo删除 location路径:
http://localhost:23323/route/demo(P3)
http://localhost:23323/route//demo(P4)
与第一种情况一致👆👆
代理路径 替换 监听路径:
http://localhost:23323/route/api/demo删除 location路径:
http://localhost:23323/routedemo(P5)
http://localhost:23323/route/demo(P6)