I have application gateway sitting in front of Azure App Service (Standard) . I have .Net Core 3.1 basic MVC web app hosted on App Service.
Problem
The problem is when I hit Application Gateway URL (default hostname) it redirects the request to Azure App Service URL which is not what I want. I want APP gateway to proxy the request but not actually redirect me to the Azure App Service.
Possible Cause:
I believe it's a known thing. Redirection is possibly being caused because of Location Header in response as mentioned here Redirection Issue in Documentation.
Steps taken:
I have tried to rewrite the URL as suggested here Rewrite Response in official documentation however when I rewrite the response header It not working. Some time I don't get the response and other times It gets into Redirection Loop. Please note I am not using custom domain as suggested in the document but default App Gateway host name (xx.australiaeast.cloudapp.azure.com)
I have tried following header values
{http_resp_Location_1}://{var_host}{http_resp_Location_2}
http://{var_host}{http_resp_Location_2}
Any help/guidance is highly appreciated.
Imran