码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2019-03-01 12:10:42      阅读:470      评论:0      收藏:0      [点我收藏+]

标签:tar   代理   127.0.0.1   ati   oca   情况   假设   style   路径   

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

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

标签:tar   代理   127.0.0.1   ati   oca   情况   假设   style   路径   

原文地址:https://www.cnblogs.com/Star-Haitian/p/10455588.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!