Azure Front Door is Showing backend pool URL

%3CLINGO-SUB%20id%3D%22lingo-sub-1111756%22%20slang%3D%22en-US%22%3EAzure%20Front%20Door%20is%20Showing%20backend%20pool%20URL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1111756%22%20slang%3D%22en-US%22%3E%3CP%3Esetting%20up%20Front%20Door%20and%20the%20behavior%20is%20not%20as%20expected.%20When%20I%20go%20to%20mylink.com%3B%20which%20is%20the%20one%20configured%20as%20my%20frontend%20host%2C%20the%20url%20on%20the%20browser%20becomes%20myapp.azurewebsites.net%3B%20which%20is%20the%20actual%20app.%20I%20have%20the%20Route%20Type%20set%20to%20Forward.%20is%20this%20expected%20behavior%3F%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fforums%2Fpostpage%2Fboard-id%2FAzure%2Fload-autosave%2Ftrue%23%22%20target%3D%22_blank%22%3EAzure%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1111756%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1112245%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20Front%20Door%20is%20Showing%20backend%20pool%20URL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1112245%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F519043%22%20target%3D%22_blank%22%3E%40EduLorenzo%3C%2FA%3E%26nbsp%3BWe%20have%20the%20exact%20same%20problem%3F%20Please%20let%20me%20know%20if%20you%20find%20the%20solution.%20Are%20you%20using%20a%20Dotnet%20Core%20App%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1117249%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20Front%20Door%20is%20Showing%20backend%20pool%20URL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1117249%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F519043%22%20target%3D%22_blank%22%3E%40EduLorenzo%3C%2FA%3E%2C%20your%20backend%20application%20is%20sending%20a%20redirect%20response%20for%20an%20*.azurewebsites.net%20URL%20(Location%20header).%20Azure%20Front%20Door%20simply%20forwards%20the%20response%20to%20the%20client%20and%20then%20the%20client%20obeys%20and%20redirects%20to%20the%20*.azurewebsites.net%20URL.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EUnfortunately%2C%20AFD%20does%20not%20support%20yet%20rewriting%20response%20headers%20(%3CA%20href%3D%22https%3A%2F%2Ffeedback.azure.com%2Fforums%2F217313-networking%2Fsuggestions%2F38507827-support-rewriting-http-headers%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Esee%20UserVoice%20issue%3C%2FA%3E)%20-%20this%20would%20allow%20you%20to%20change%20the%20Location%20header%20coming%20in%20the%20response%20to%20AFD's%20custom%20domain%20name.%20You%20must%20thus%20ensure%20your%20application%20does%20not%20perform%20redirects%20when%20responding%20to%20AFD%20or%20else%20consider%20changing%20your%20solution%20architecture.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1117273%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20Front%20Door%20is%20Showing%20backend%20pool%20URL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1117273%22%20slang%3D%22en-US%22%3E%3CP%3E%3CIMG%20src%3D%22https%3A%2F%2Freporting.msops.microsoft.com%2Flogout.aspx%22%20border%3D%220%22%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1119109%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20Front%20Door%20is%20Showing%20backend%20pool%20URL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1119109%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F453722%22%20target%3D%22_blank%22%3E%40hspinto%3C%2FA%3E%26nbsp%3Bunderstood.%20So%2C%20how%20do%20I%20go%20about%20this%20scenario%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20url%20for%20the%20app%20is%20myapp.com%20pointed%20to%20AFD%3B%20which%20is%20myapp.azurefdnet%3B%20which%20in%20turn%20is%20routed%20to%20myazureapp.azurewebsites.net%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E2.%20what%20do%20I%20use%20to%20get%20myapp.com%20from%20code%2C%20as%26nbsp%3B%3C%2FP%3E%3CDIV%3EHttpContext.Current.Request.Url%20returns%26nbsp%3Bmyazureapp.azurewebsites.net%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1474165%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20Front%20Door%20is%20Showing%20backend%20pool%20URL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1474165%22%20slang%3D%22en-US%22%3E%3CP%3EAre%20you%20able%20to%20find%20the%20solution%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
New 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?