我有我的nginx的conf像:「位置」 和nginx的 「proxy_pass」 的不同水煤漿的X加速 - 重定向
location ^~ /mount_points/mount_point1 {
internal;
alias /repos/mount_point_one;
}
location ^~ /to_proxy {
internal;
proxy_pass http://myproxy:5000;
}
當我請求 'http://localhost/mount_points/mount_point1/myfile.zip' 我得到「/回購/ mount_point_one/MYFILE .zip「如預期。
雖然要求'http://localhost/to_proxy/myfile2.html',我得到「http://myproxy:5000/to_proxy/myfile2.html」。
在第一種情況下,「/ mount_points/mount_point1」部分被刪除,第二種情況下,「/ to_proxy」部分仍然存在,我必須在上游服務器中僞造一個「/ to_proxy」地址找出這個。
我錯過了什麼嗎?如果我只需要重寫url,如何刪除上游服務器的「/ to_proxy」部分問題?
謝謝。
謝謝@RichardSmith,後'/'工作! – chenxin