Skip to main content
Version: 3.2.0

fix-spa-static-exclude

🐛 Bug Fixes​

SPA fallback 500 on /auth/callback​

Goal: Nexus login must return to the Tower UI. After operator docs were shipped in the image, GET /auth/callback returned Nest 500 JSON instead of index.html, so the OAuth exchange never ran.

Solution: ServeStatic exclude used path-to-regexp v6 syntax (/api/(.*), /docs/(.*)). Nest 11 compiles those with path-to-regexp v8 and throws on every SPA fallback. Use {*path} (same as the Nest 11 sample). /api/v1/* and /docs stay off the SPA; /auth/callback, /login, and other UI routes still get index.html.

Files Modified:

  • src/app.static-roots.ts - path-to-regexp v8 exclude patterns
  • src/app.static-roots.spec.ts - compile + Nest isRouteExcluded coverage for SPA vs API/docs