当前位置:首页 > 服务器技术 > nginx

nginx配置proxy_pass URL末尾加与不加/(斜线)的区别

nginx在配置proxy_pass的时候 URL结尾加斜线(/)与不加的区别和注意事项

 

 

假设访问路径的 /pss/bill.html

加/斜线的情况
location /pss/ {
proxy_pass http://127.0.0.1:18081/;
}

被代理的真实访问路径为:http://127.0.0.1:18081/bill.html

 

 不加/斜线的情况

location /pss/ {
proxy_pass http://127.0.0.1:18081;
}

 被代理的真实访问路径为:http://127.0.0.1:18081/pss/bill.html

技术分享

原文:http://www.cnblogs.com/peachyy/p/7649794.html


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:254677821)!