Search code examples
azureazure-front-door

Azure Front Door keep custom URL in redirects


I have configured custom URL (let's say contoso.com) into Azure Front Door and routed that into App service (contoso.azurewebsites.net). Now when the customer navigates into https://contoso.com the Front Door redirects user into contoso.azurewebsites.net which is correct, but the URL in the browser changes into contoso.azurewebsites.net. Is it possible to configure Front Door to keep the original URL (contoso.com), or do I need to add some configuration into App Service?


Solution

  • "Backend host header" set to be blank and add your front door domain (https://contoso.com) to your app services custom domains with the certificate.

    Front Door uses Backend host header to call the app service so request tells the App to use the *azurewebsites.net address as it's hostname. "Backend host header" set to be blank just passes the request hostname along to the backend. You need to add it to a custom domain so that the app service can accept that hostname.

    https://edi.wang/post/2020/6/29/solving-azure-ad-sign-in-failure-with-azure-front-door