We have a website where the frontend is a SPA that is hosted in Azure Blob storage, and the backend is hosted in Azure App Service. The site will be fronted by Azure Front Door. I'm trying to route requests to the correct backend.
All endpoints in the site hosted in App Service have the format /backend/*.
In the frontend we have some files in the root, /index.html and a few others like favoicon.ico, and then some files in an /assets folder. The only common thing about these is that they have a period in the filename.
The SPA has dynamic urls, e.g. /login that don't correspond to any physical file.
I would like the below routes in Front Door but I'm having problems creating a rule for the /*.*
pattern, i.e. routing everything that looks like a file to blob storage without url rewriting.
╔═══════════════════════════════╦═══════════════╦══════════════╦══════════════════════════════════════════════════╦══════════════════════════════════════════════════════════════════════════════════════════════╗
║ Source url ║ Route pattern ║ Backend pool ║ Target url ║ Description ║
╠═══════════════════════════════╬═══════════════╬══════════════╬══════════════════════════════════════════════════╬══════════════════════════════════════════════════════════════════════════════════════════════╣
║ www.example.com/backend/login ║ /backend/* ║ App service ║ ourbackend.azurewebsites.net/backend/login ║ All backed routes ║
║ www.example.com/ ║ / ║ Blob storage ║ ourstaticstorage.web.core.windows.net/index.html ║ Requests to the root should return index.html from blob storage ║
║ www.example.com/favicon.ico ║ /*.* ║ Blob storage ║ ourstaticstorage.web.core.windows.net/*.* ║ Blob storage contains other static files that should be returned. All files contain a period ║
║ www.example.com/scripts.css ║ /*.* ║ Blob storage ║ ourstaticstorage.web.core.windows.net/*.* ║ Blob storage contains other static files that should be returned. All files contain a period ║
║ www.example.com/styles.css ║ /*.* ║ Blob storage ║ ourstaticstorage.web.core.windows.net/*.* ║ Blob storage contains other static files that should be returned. All files contain a period ║
║ www.example.com/login ║ /* ║ Blob storage ║ ourstaticstorage.web.core.windows.net/index.html ║ Catch all route for deep links in the spa ║
╚═══════════════════════════════╩═══════════════╩══════════════╩══════════════════════════════════════════════════╩══════════════════════════════════════════════════════════════════════════════════════════════╝
Is there some other way to get this done?