totalfreakingnoob
totalfreakingnoob

Reputation: 423

Azure: Route traffic from different subdomains and URLs to different backend ports

I have multiple sites hosted on the same machine in Azure on different ports:

contoso.com:8000
contoso.com:8001
contoso.com:8002
contoso.com:8003 

and single sites hosted on separate machines:

foo.com:8000
foo2.com:8000

I would like to address these by different URLs and different subdomains using a reverse proxy;

w1.fabrikam.com/I1 -> contoso.com:8000
w1.fabrikam.com/I2 -> contoso.com:8001
w2.fabrikam.com -> foo.com:8000
w3.fabrikam.com -> foo2.com:8000

There is a similar post to this that was answered but used subdomains only. Is it possible to use subdomains as well as URL rules with application gateway?

Azure: Route subdomain traffic to different backend port

Upvotes: 0

Views: 598

Answers (1)

Nancy Xiong
Nancy Xiong

Reputation: 28294

To address different subdomains to different backends, you can configure multiple-sites listener for each backends:

w2.fabrikam.com -> foo.com:8000
w3.fabrikam.com -> foo2.com:8000

For this, you could create two backend pools, and create two multi-hosting listeners.

You could refer to https://learn.microsoft.com/en-us/azure/application-gateway/multiple-site-overview and https://learn.microsoft.com/en-us/azure/application-gateway/create-multiple-sites-portal

To address these by different URLs, you could configure path-based routing rules.

w1.fabrikam.com/I1 -> contoso.com:8000
w1.fabrikam.com/I2 -> contoso.com:8001

For the Path-based routing, select Add multiple targets to create a path-based rule. For Path, type /I1/* or /I2/*.

For the HTTP settings, create two HTTP settings, select the backend port 8000 or 8001 for each HTTP settings.

You could refer to https://learn.microsoft.com/en-us/azure/application-gateway/create-url-route-portal

Upvotes: 1

Related Questions