Apex Domain Angular Azure Static Web App - 404 on Refresh or Direct Link Navigation
I have an Angular web application hosted with Azure Static Web App. I have registered the app with a custom domain using the apex domain(s) (www.<myapp>.com and <myapp>.com). I have added a staticwebapp.config.json to properly route refreshes or direct link navigation through the Angular application's routing. The staticwebapp.config.json contains the following content:
{
"navigationFallback": {
"rewrite": "/index.html",
"exclude": ["/assets/images/.{png,jpg,gif}", "/css/"]
}
}
This configuration does not appear to be working. Navigating directly to valid application links loads the Azure 404 page instead of falling back to the app's routing. I am wondering if I am missing a piece of configuration for the apex domain to properly reroute to the client application.
The same configuration works fine in a separate Azure Static Web App deployment set up as the "staging" environment. It is using the same custom domain, but is using a different, non-apex subdomain (staging.<myapp>.com).