Repository navigation
fix(server): serve Swagger /docs correctly behind a reverse-proxy path prefix - #96
Closed
gustavobertoi wants to merge 2 commits into
Closed
gustavobertoi wants to merge 2 commits into
gustavobertoi wants to merge 2 commits into
Conversation
…h prefix When FUSE is hosted under a sub-path (e.g. api.example.com/fuse), the /docs redirect used an absolute /docs/index.html, so the browser dropped the /fuse prefix and 404'd. Now the redirect honors the proxy's X-Forwarded-Prefix header, falling back to a new SERVER_BASE_PATH config; and the Swagger UI loads its spec via a relative URL (doc.json) so it resolves under the prefix automatically (or an absolute base-path URL when SERVER_BASE_PATH is set). Root hosting is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Superseded by the consolidated PR #97 (which includes this docs base-path fix along with the agent leaf capabilities that need re-landing). |
This branch was previously deployed
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.
Problem
When FUSE is hosted under a sub-path (e.g.
api.uranus.com.br/fuse), opening/docs404s: the/docshandler redirected to the absolute/docs/index.html, so the browser dropped the/fuseprefix.Fix
/docsredirect now honors the proxy'sX-Forwarded-Prefixheader, falling back to a newSERVER_BASE_PATHconfig (e.g./fuse). The redirect target becomes<prefix>/docs/index.html.doc.json), which resolves under the prefixautomatically (
<prefix>/docs/doc.json); whenSERVER_BASE_PATHis set it uses the explicitabsolute URL.
Usage
Set
SERVER_BASE_PATH=/fuse(or have the proxy sendX-Forwarded-Prefix: /fuse). Documented in.env.example.Verify
make lint0 ·make buildok ·make test699 pass. Manual: behind a proxy at/fuse,GET /fuse/docs→ redirects to/fuse/docs/index.htmland the UI loads the spec.🤖 Generated with Claude Code