A common cause is a missing hosting fallback for client-side routes. Clicking inside the app lets the browser’s router choose the view. Refreshing /projects/example asks the server for that address directly, and a static host may look for a file that does not exist. 12
Confirm which request fails
Open a valid nested route through the menu, then refresh it with the browser’s Network panel open. Inspect the document request, not just the console. Compare that result with opening the same URL in a new tab.
If the document returns 404 before the app loads, investigate hosting rules. If the document loads successfully but a JavaScript file fails, record that asset’s URL instead. These are different failures and should not receive the same blanket fix.
Serve the app for valid application routes
A static SPA host needs to serve the client entry page for application URLs. React Router’s deployment guide identifies missing host configuration as a likely cause of 404s on valid routes. 2
For nginx, Vue Router documents this fallback: 1
location / {
try_files $uri $uri/ /index.html;
}Adapt it to the deployment. Keep API requests and asset handling in their appropriate locations. If the app lives under a subdirectory, check its router base and deployed paths as well. Test a nested route, a real asset and an API endpoint after changing the rule.
Preserve missing-page behavior
A catch-all can make nonexistent URLs return HTTP 200. Showing a client-side “not found” component does not automatically change that server response. For public pages, return a genuine 404 where the architecture supports it, or apply an appropriate SPA error-page strategy. 13
This advice concerns static client-rendered apps. A server-rendered deployment needs its framework’s server routing; replacing that with a blanket index.html rewrite can hide the actual configuration problem.