如何使nginx重定向到不同的端口

时间:2017-02-16 18:19:35

标签: nginx nginx-location

我在nginx.conf文件中有以下位置块。

Location /e-ui/ {
    proxy_pass https://hostname:9000
}

我需要知道如何以下列方式重定向网站:

https://abc/e-ui/应重定向到https://abc:9000

OR

https://xyz/e-ui/应重定向到https://xyz:9000

服务器名称正在更改(因为代码部署在许多服务器上)。无论如何我可以从/ etc / hosts文件中获取服务器名称,如果它已经在那里定义并以某种方式使用它来重定向网站,如上所述?

谢谢。

0 个答案:

没有答案