nginx的點API網址住網站nginx的點API網址住網站
位置= http://localhost:5100/services/v1/ { proxy_pass https://test.com/services/v1/; }
nginx的點API網址住網站nginx的點API網址住網站
位置= http://localhost:5100/services/v1/ { proxy_pass https://test.com/services/v1/; }
確保你只在服務器塊監聽端口5100,以保證重定向只發生在5100
server {
listen 5100;
server_name localhost;
location /services/v1/ {
proxy_pass https://test.com/services/v1/;
}
}
假設你的目的是要向前/服務/ V1/* API請求到test.com, 位置/服務/ V1/ { proxy_pass https://test.com/services/v1/; }
是但只針對端口5100 –
是真實的。想強調不要在位置塊中使用=。這是爲了確切的URI匹配。 – OneWorld
nginx返回204沒有內容 –