minimuz
minimuz

Reputation: 141

Application gateway URL path-based routing always redirect to default backend pool

I have configured 4 webapps behind Application gateway (ARM template):

web app settings

I can open web apps when I go directly to dummyapiX.azurewebsites.de/servicehosts/dummyapiX.

I want routing work this way: when I go to https://PIPofApplicationGateway/servicehosts/dummyapiX it should redirect to

dummyapiX.azurewebsites.de/servicehosts/dummyapiX

But Application Gateway always redirect to default backend pool, therefore I get 404 error.

I created Custom probes that point to:

Backend health show Healthy status for all. Backend pools point to webapps FQDN. PickHostNameFromBackendAddress for httpsSettings and PickHostNameFromBackendHttpSettings for probes are set to true. No other Path related setting are not configured in httpsSettings.

The only path-based rule is:

Any suggestion? What might be a root cause?

Upvotes: 2

Views: 3550

Answers (2)

minimuz
minimuz

Reputation: 141

The root cause was trailing "/" in path in rules.

So instead of:

"/servicehosts/dummyapi1/*" to backendpooldummy1
"/servicehosts/dummyapi2/*" to backendpooldummy2
"/servicehosts/dummyapi3/*" to backendpooldummy3

It should be in my case

"/servicehosts/dummyapi1*" to backendpooldummy1
"/servicehosts/dummyapi2*" to backendpooldummy2
"/servicehosts/dummyapi3*" to backendpooldummy3

Now everything works

Upvotes: 4

Nancy Xiong
Nancy Xiong

Reputation: 28214

Firstly, you can confirm if you have created the virtual directory in your web app setting. Make sure the URL-based rule maps to the specific backend pool. Create the basic listener with a listening request port. Create and map a Path-based rule and bind to the listener. Get more details from this tutorial.

Then, you can type ipconfig /flushdns to clear the DNS cache In the command prompt console. Verify it again.

Ref: Error 404 : Web App Not Found – Azure Web App

Upvotes: 0

Related Questions