Skip to content

v0.0.5

Choose a tag to compare

@github-actions github-actions released this 12 Jun 08:54

fix: support deployment under a sub-path via NEXT_PUBLIC_BASE_PATH (#1)

Behind an nginx sub-path proxy (location /ops/) every /_next asset and
/api request resolved to the domain root and came back as HTML,
breaking the app with 'Unexpected token <'.

  • next.config.ts: wire basePath from NEXT_PUBLIC_BASE_PATH (build-time)
  • request(): prefix API calls and the 401 login redirect with basePath;
    route the auth pages' direct fetch calls through it
  • ws: client URL and server upgrade path accept the prefixed /ws
  • proxy: build the login redirect from nextUrl.clone() so the basePath
    is preserved (new URL('/login', req.url) drops it)
  • Dockerfile: NEXT_PUBLIC_BASE_PATH build arg; README: nginx sub-path
    deployment guide (proxy_pass without trailing slash)

Verified with a /ops build: pages/assets/API all serve under /ops,
unauthenticated pages 307 to /ops/login, and a default build keeps
serving at the root unchanged.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com