Let's say I have an app hosted at . The problem is that, due to the way the app is configured, it returns a 404 error when accessed at the root URL. So, whenever a request is made to , it should be redirected to .
I followed the steps in this Azure Application Gateway WAF V2 redirect request, but the redirect still doesn't work. I continue to get a 404 error, and the redirection never happens.
I suspect the issue is that the root URL returns a 404 error (even though I have set up a health probe), preventing the WAF from processing the redirection rules. If that's the case, how can I fix it?
Let's say I have an app hosted at http://example. The problem is that, due to the way the app is configured, it returns a 404 error when accessed at the root URL. So, whenever a request is made to http://example, it should be redirected to http://example/test.
I followed the steps in this Azure Application Gateway WAF V2 redirect request, but the redirect still doesn't work. I continue to get a 404 error, and the redirection never happens.
I suspect the issue is that the root URL returns a 404 error (even though I have set up a health probe), preventing the WAF from processing the redirection rules. If that's the case, how can I fix it?
Share Improve this question asked Mar 14 at 21:43 John BakerJohn Baker 294 bronze badges 2- If you want to redirect traffic from example to example/test, make sure the redirect rule is set up properly in the Rewrite or Redirect configuration. – Venkat V Commented Mar 15 at 7:32
- You can also achieve this through the backend setting override option. For more information, see learn.microsoft/en-us/azure/application-gateway/… – Venkat V Commented Mar 15 at 7:43
1 Answer
Reset to default 0Azure (WAF) Redirect from Root URL somewhere inside the app
If you want to redirect your application to another path using an application gateway, you can configure the Override Backend Path in the backend settings with your application path (e.g., /websocket). Make sure to add the path in Path-based Routing
Whenever I hit the application gateway's public IP, it picks the hostname from the backend pool and redirects to another path, as shown below.
Here is the output:
Reference: Override backend path