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

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?




2 Answers
2



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.


ipconfig /flushdns



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





First, I can confirm that my webapp are created as indicated in tutorial. Second, clear DNS cache does not help
– minimuz
Aug 29 at 11:26






I've updated topic with screenshot of Web App settings
– minimuz
Aug 29 at 14:36





Can you show the Path-based rule and how to bind to the listener?
– Nancy Xiong - MSFT
Aug 29 at 14:44





I have only one HTTPS listener and one path-based rule that binded to this listener, It is 3 rules "/servicehosts/dummyapiX/*" to "backendpooldummyX"
– minimuz
Aug 29 at 14:54






tbh, this thing from tutorial bugs me: "Before we start to map this, we should know the route you mapped for your web apps should be the application root path of your web app " In my case WebApp VirtualDirectory settings are not as in tutorial, because WebApps are in subfolder /servicehosts/. Even if WebApps are accessible by URLs, it might not work with path-based routing
– minimuz
Aug 30 at 8:37




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






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)