Single endpoint with multiple routes are not routing traffic as expected

Ross Watson 0 Reputation points
2025-03-18T12:35:39.5933333+00:00

I have an Azure Front Door endpoint which contains two routes, each route has the same domains.

The first route will route traffic to my CMS application.
The second route will route traffic to my CMS Admin application.

Azure Front Door Endpoint:
User's image

Route 1 - to CMS application
User's image

Route 2 - to CMS Admin application

User's image

Now to test this I have custom error turned off for the CMS application and not for the CMS Admin application,

When I browse: domain.com/ I am successful routed to my CMS application.

When I browse: domain.com/admin/login.aspx, I am routed to a default ASP.NET error page so I can see that traffic is still hitting the CMS application and not the CMS Admin application.

I have created a separate endpoint that using the domains like admin.domain.com and pointed it to the same origin group as the second route, just with /* as the path and I am able to browse admin.domain.com/admin/login.aspx and the application load as expected.

This proves that the CMS Admin application does in fact works. The origin and origin group are working as expected.

It just seems like the routes in the endpoint is not working as expected and I cannot find a solution to the problem.

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
818 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Rohith Vinnakota 4,005 Reputation points Microsoft External Staff
    2025-03-24T18:41:07.9233333+00:00

    Hi @Ross Watson

    From your screenshots, I can say that the root cause of your issue is the empty origin host header.

    Let us first understand what origin host header does. Requests that are forwarded by Azure Front Door to an origin will include a host header field that the origin uses to retrieve the targeted resource.

    For example, a request made for www.contoso.com will have the host header www.contoso.com. If the request was made for www.contoso.com, and your origin contoso-westus.azurewebsites.net has an empty header field, Front Door will set the host header as www.contoso.com.

    Most app backends (Azure Web Apps, Blob storage, and Cloud Services) require the host header to match the domain of the backend. However, the frontend host that routes to your origin will use a different hostname such as www.contoso.net.

    If your origin requires the host header to match the origin hostname, make sure that the origin host header includes the hostname of the origin.

    Refer: https://learn.microsoft.com/en-us/azure/frontdoor/origin?pivots=front-door-standard-premium#origin-host-header

    You are using Azure App service as your backend, and you also mentioned that there is no custom domain configured on your App service. Now, if the origin host header is kept empty, the AFD will forward the request including a host header as your custom domain, but it is not configured on your App service and hence it will not match with your App service domain and eventually fail with 404 not found error. Because the App Service doesn't recognize the custom domain and rejects all incoming requests for this host name. It can't determine where to route the request.

    Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.
    User's image


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.