如何在Azure应用程序网关中重定向多个URL?

时间:2019-12-15 23:28:38

标签: azure redirect azure-application-gateway

在Azure应用程序网关中,可以执行以下重定向:

fieldnames=keyword.split() 

我为第一次重定向添加了一个侦听器和规则,并且该规则有效。我试图通过Azure仪表板添加多个规则,但是看到以下错误:

example.com/folder1/page1.html > newexample.com
www.example.com/folder1/page1.html > newexample.com
example2.com/folder2/page2.html > newexample.com/page2.html

当我尝试添加另一个基本侦听器时,我看到:

There are no unassociated listeners available. Create a new listener and then try again.

此外,如果我将现有规则更改为重定向到另一个URL,则它似乎没有更新-我已重定向到原始站点。

感谢您的帮助。

2 个答案:

答案 0 :(得分:0)

我决定在nginx中设置虚拟主机并重定向域。这似乎比配置Azure应用程序网关简单得多。

<VirtualHost *:8080>
    ServerName   www.example.org.uk
    ServerAlias  example.org.uk
    Redirect 301 / https://www.newexample.com/abc/def/ghi
</VirtualHost>

答案 1 :(得分:0)

在我看来,您需要配置多个站点侦听器,请参阅以下链接: https://docs.microsoft.com/en-us/azure/application-gateway/multiple-site-overview