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

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

 

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

加/斜线的状况spa

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

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

 

 不加/斜线的状况code

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

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

相关文章
相关标签/搜索