For rewriting URLs on Linux, you can reference NGINX Rewrite Rules for Azure App Service Linux PHP 8.x - (azureossd.github.io). I realize its PHP, but the base image is Linux based so the principals are still applicable.
When I've hit 404 errors like you have, my issue was with the route itself. In my markup, I did not have the correct path. You could have same thing but use the browser developer tools Networking tab to confirm. If not, could you provide additional context on your environment the type of URLs that are ending up 404, e.g.
- Are they links within the SPA or SPA to API?
- Is your SPA standalone or a front-end hosted within an ASP.NET backend