Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly configure Azure Application Gateway Rewrite URL rule?

We are using azure application gateway to route requests from host/client to the specific client app (.NET Core). This way client1 is routed to server1/client1 and client2 is routed to server2/client2 and so on. We are using URL path map to resolve the exact server for each client.

Application gateway has a limitation in 100 paths in URL Path map per listener. This forces us to keep the number of client applications low. Recently we have rewritten our application to support multiple tenants. So now we can process multiple clients' requests using a single app. Our new routing looks like server/app/client. Still, we want to keep end-clients URLs in the same way as those are: host/client

My idea was next: Use Application gateway rewrite set, and on request, replace URL path values from /client to /app/client; But it seems that no matter what I set into those rules I do I keep getting the same response. It looks to me that rewrite rules are simply ignored. Even the basic one that does not contain any if logic. e.g.:

super simple rule -

  • So my question is whether it is possible to update request URL before application gateway rules are applied?

Will be really glad to get some help here.

like image 933
Yurii Horak Avatar asked May 20 '20 17:05

Yurii Horak


People also ask

What is rewrite rule in Application Gateway?

In the case of a URL rewrite, Application Gateway rewrites the URL before the request is sent to the backend. This will not change what users see in the browser because the changes are hidden from the user. In the case of a URL redirect, Application Gateway sends a redirect response to the client with the new URL.

How do you configure path based routing in Azure Application Gateway?

You can use the Azure portal to configure URL path-based routing rules when you create an application gateway. In this tutorial, you create backend pools using virtual machines. You then create routing rules that make sure web traffic arrives at the appropriate servers in the pools.


1 Answers

Don't know if you solved your problem but I had exactly the same ! It looks like Microsoft made some changes few days ago on Application Gateway. And now it works ! But I had to delete my Application Gateway and create it again from scratch. Hope this will help

Denis

like image 100
denis.demuliere Avatar answered Oct 21 '22 13:10

denis.demuliere