feat(server): runtime base path support for reverse proxy deployments#28326
Open
fabiovincenzi wants to merge 8 commits into
Open
feat(server): runtime base path support for reverse proxy deployments#28326fabiovincenzi wants to merge 8 commits into
fabiovincenzi wants to merge 8 commits into
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Related PRs FoundThis PR (28326) supersedes several earlier attempts at solving the same problem, as noted in the description. Here are the related PRs:
Why they're related:
This PR consolidates all the learnings into a complete implementation with both CLI flag support, server-side request interception, HTML injection, and frontend SolidJS router integration. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #7624
Type of change
What does this PR do?
Adds a
--base-pathflag (alsoserver.basePathin config) so opencode web works behind a reverse proxy at a prefix likeplatform.com/opencode/.The server strips the prefix before routing, redirects
/opencode→/opencode/, and returns 404 for anything outside the prefix.The UI picks up the base path via an injected global so the SolidJS router and API calls use the right URLs.
Vite base changed to "./" for relative chunk imports.
Supersedes #7625, #18209, #25513, #23912.
How did you verify your code works?
Built with
bun run --cwd packages/opencode build -- --single, ranopencode web --base-path /opencode.UI loads, assets resolve, API works under prefix, 404 outside it, 301 redirect without trailing slash, no breakage without the flag.
Screenshots / recordings
N/A — no visual changes, only routing behavior.
Checklist