An Azure service that provides streamlined full-stack web app development.
Thanks for the thorough follow-up and all the verification steps — it's clear you've done a solid job isolating this. Since the standard hybrid setup (standalone output + empty output_location) hasn't resolved the 404 on /login, let's focus on the most likely remaining causes for App Router server-rendered routes in the hybrid preview.
Quick Diagnostic Checks:
- Test the health endpoint
This is critical in hybrid mode: Visit https://rtuo-llc.net/.swa/health.html (and the default *.azurestaticapps.net version). It should return a successful page. If this returns 404 or fails, the managed backend isn't activating properly, causing all dynamic routes to 404. - Review the detailed deployment logs in the Azure portal (Deployments > latest run) for any warnings about the backend, standalone folder, or route handling.
- Check Application Logs (portal > your SWA > Logs) right after hitting /login for backend errors.
Make sure your setup exactly matches the official guidance:
- next.config.ts: output: 'standalone'
- Workflow:
- app_location: "rtuo-frontend"
- output_location: "" (empty)
- api_location: "" (empty)
- If you have middleware.ts, it must exclude the SWA health check: TypeScript
export const config = { matcher: ['/((?!.swa).*)'], };
If the health check passes and logs look clean but /login still 404s, the hybrid preview may be hitting an edge case with your specific App Router setup (some dynamic features or middleware interactions are still maturing).
Recommended Next Action:
As a clean test, try recreating the Static Web App resource (or a new one) using the Next.js preset in the Azure portal wizard, then link your repo with the exact settings above. This often clears any stale routing state.
If that doesn't resolve it, the shortest path to production stability right now is often switching to a full server hosting option like Azure App Service (Node.js) or Azure Container Apps, where Next.js runs without the hybrid preview limitations.
Reference:
https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-nextjs-hybrid
https://learn.microsoft.com/en-us/azure/static-web-apps/nextjs
Kindly let us know if the above helps or you need further assistance on this issue.Please "upvote" if the information helped you. This will help us and others in the community as well.