Warm tip: This article is reproduced from stackoverflow.com, please click
azure redirect azure-application-gateway

How do I redirect multiple URLs in Azure Application Gateway?

发布于 2020-04-10 16:00:56

In Azure Application Gateway, is it possible to do the following redirects:

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

I've added a single listener and rule for the first redirect and that is working. I've tried to add multiple rules through the Azure dashboard, but see the following error:

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

When I try to add another basic listener, I see:

This HTTP listener cannot use the same frontend port as an existing listener.

Also, if I change the existing rule to be redirect to another URL, it doesn't appear to update - I am redirected to the original site.

Any help is appreciated.

Questioner
Confounder
Viewed
50
Confounder 2020-01-03 01:07

I decided to set up vhosts in nginx and redirect the domains. It seemed much simpler than configuring the Azure Application Gateway.

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