1
votes

I am running an ASP.NET MVC application on Azure App Service with a Front door.

The front door is setup with a custom domain and points to myapp.azurewebsites.net as backend.

Going to mysite.mydomain.com shows the expected page, but the host records myapp.azurewebsites.net as the request url instead of mysite.mydomain.com.

This issue affects Google external login which uses PathString to set my returnurl to myapp.azurewebsites.net/signin-google and my logging which uses Request.Url to login the requested page.

1

1 Answers

0
votes

The configuration of a backend in a Front Door backend pool includes a Backend host header field, which determines the host name used for forwarded requests. By default, this is set to the backend host name, meaning all requests forwarded to this backend will appear to the backend by its own host name. You can either change the value of this field to another host name (e.g. mysite.mydomain.com in your example), or leave it blank to always make it use the request host name.

Check out the documentation on this topic here.

As noted in the comments, your backend will need to be able to accept requests under the custom host name. In the case of an Azure Web Application, this means also adding the custom host name to the Web App.