2017-10-09 83 views
0

我有一個快速響應應用程序。我正在運行Nginx作爲反向代理。該應用程序使POST請求的相對URL爲/api/rest/2/issue/。如何重寫url以使用不同的主機,例如https://example.com/api/rest/2/issue/用於POST請求。重寫POST請求到NGINX中的不同主機

正常的GET請求必須到標準端口80

我在我的虛擬主機嘗試這樣:

location /rest/api/2/issue { 
    proxy_pass https://example.com/rest/api/2/issue; 

回答

1

你只需要簡單地

location /rest/ { 
    proxy_pass https://example.com/rest/; 
}