Skip to content

Support reverse-proxy base paths - #213

Draft
DaehoYang wants to merge 5 commits into
friuns2:mainfrom
DaehoYang:agent/reverse-proxy-base-path
Draft

Support reverse-proxy base paths#213
DaehoYang wants to merge 5 commits into
friuns2:mainfrom
DaehoYang:agent/reverse-proxy-base-path

Conversation

@DaehoYang

Copy link
Copy Markdown

Summary

  • Resolve frontend HTTP, WebSocket, fetch, download, and local-content URLs relative to the document base URL.
  • Emit relative Vite and PWA asset paths so the application can run below an arbitrary reverse-proxy prefix.
  • Keep authentication, local browser/editor navigation, error-page redirects, and the opt-in service worker within the application scope.
  • Preserve the existing root-mounted behavior as a fallback when no browser document is available.

Motivation

The application currently assumes it is mounted at /. That breaks assets, API calls, WebSockets, local file navigation, and PWA resources when it is exposed through a path-based reverse proxy such as /proxy/5900/.

This change derives the public URL prefix from document.baseURI, so the server does not need provider-specific configuration or knowledge of the external proxy path.

Validation

  • npm run test:unit — 16 files, 153 tests passed
  • npm exec -- vue-tsc --noEmit
  • npm exec -- vite build
  • npm exec -- tsup
  • JupyterHub + jupyter-server-proxy smoke test at /user/<name>/proxy/4200/
    • document and relative assets returned HTTP 200
    • API endpoint returned HTTP 200
    • WebSocket connection succeeded
    • browser recorded 35 requests with no same-origin request escaping the proxy prefix
  • Opt-in service worker test through an HTTP subpath proxy
    • registration scope remained under /proxy-test/
    • shell cache codexweb-shell-v3 was created
    • no request escaped the proxy prefix

Notes

Service worker registration remains opt-in through VITE_ENABLE_SERVICE_WORKER=1. Root-mounted deployments continue to resolve to the same endpoints as before.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1a6971f4-ead1-4a8b-ab82-b8de45718d59

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant