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.
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.