
3 Pitfalls When Serving Next.js + FastAPI via nginx Subpath — trailingSlash, Routing Separation, and MuleSoft SSE Buffering
lin-yuchen2026.06.21
- • Combining Next.js basePath with trailingSlash is essential to avoid 404 errors when serving via nginx subpath
- • Separate frontend and backend routing using nginx path-based rules with unified API prefixes
- • MuleSoft API Gateway buffers SSE responses; bypass it for streaming endpoints using BFF pattern


