Azure Front Door is Showing backend pool URL

Copper Contributor

setting up Front Door and the behavior is not as expected. When I go to mylink.com; which is the one configured as my frontend host, the url on the browser becomes myapp.azurewebsites.net; which is the actual app. I have the Route Type set to Forward. is this expected behavior?

Azure 

5 Replies

@EduLorenzo We have the exact same problem? Please let me know if you find the solution. Are you using a Dotnet Core App?

@EduLorenzo, your backend application is sending a redirect response for an *.azurewebsites.net URL (Location header). Azure Front Door simply forwards the response to the client and then the client obeys and redirects to the *.azurewebsites.net URL.

 

Unfortunately, AFD does not support yet rewriting response headers (see UserVoice issue) - this would allow you to change the Location header coming in the response to AFD's custom domain name. You must thus ensure your application does not perform redirects when responding to AFD or else consider changing your solution architecture.

@hspinto understood. So, how do I go about this scenario?

 

1. url for the app is myapp.com pointed to AFD; which is myapp.azurefdnet; which in turn is routed to myazureapp.azurewebsites.net

 

2. what do I use to get myapp.com from code, as 

HttpContext.Current.Request.Url returns myazureapp.azurewebsites.net

Are you able to find the solution?