nginx下proxy_pass後加/和不加/區別

nginx主要配置文件以下:
nginx下proxy_pass後加/和不加/區別html

說明:
一、訪問http://localhost/proxy1/1.html 對應的實際訪問地址爲 http://localhost:8080/proxy1/1.html
二、訪問http://localhost/proxy2/1.html 對應的實際訪問地址爲 http://localhost:8080/1.html
三、訪問http://localhost/proxy3/1.html 對應的實際訪問地址爲 http://localhost:8080/test/1.html
四、訪問http://localhost/proxy4/1.html 對應的實際訪問地址爲 http://localhost:8080/test/1.html
這裏三、4感受沒有區別。
可是經過nginx error日誌模式查看到 配置3(proxy3的訪問信息以下,截取部份)
nginx下proxy_pass後加/和不加/區別
nginx下proxy_pass後加/和不加/區別
配置4(proxy4的訪問信息以下,截取部份)
nginx下proxy_pass後加/和不加/區別
nginx下proxy_pass後加/和不加/區別
記錄下,有問題請你們指出,謝謝。nginx

相關文章
相關標籤/搜索