nginx在配置proxy_pass的時候 URL結尾加斜線(/)與不加的區別和註意事項 假設訪問路徑的 /pss/bill.html 被代理的真實訪問路徑為:http://127.0.0.1:18081/bill.html 不加/斜線的情況 被代理的真實訪問路徑為:http://127.0.0.1 ...
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