Conversation
swelborn
force-pushed
the
serve-ui-under-url-prefix
branch
from
September 22, 2026 18:58
4d4615b to
8e458b5
Compare
2 tasks
uvicorn does not normalize root_path and builds the ASGI scope's path as root_path + path, so a value written as "tiled" or "/tiled/" corrupts every URL the server generates. Coerce it to "" or "/prefix" in config validation, before uvicorn ever sees it, and again when reading it back out of a request scope.
uvicorn sets scope['path'] to root_path + path, and get_root_url() also appends root_path, so the code-exchange redirect_uri repeated the prefix and no longer matched the one sent to /authorize. Build it from get_current_url, which counts the prefix exactly once. Replace the OIDC MockRequest with a real Request, so its url is derived from its scope rather than hardcoded independently of it.
going to landing page without trailing slash resolved it against the parent directory and produced /ui/browse/ instead of /tiled/ui/browse/.
The built UI hardcoded /ui/ as its base path, so a deployment behind a reverse proxy prefix had to rebuild the frontend. Build it with relative asset URLs and a <base href="/ui/"> that the server rewrites per request from the ASGI root_path, the same source get_root_url uses; the frontend derives the API and UI URLs from that base. One build now serves any prefix; TILED_BUILD_PUBLIC_PATH can no longer be honored and warns when set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Check that web-frontend/index.html still carries the <base> tag the server rewrites, so the two cannot drift apart silently. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
swelborn
force-pushed
the
serve-ui-under-url-prefix
branch
from
September 22, 2026 20:05
8e458b5 to
2043c3b
Compare
This branch has not been 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.
This is stacked on #1530, so that will merge first. There is some issue with stacked branches as a fork contributor...
The UI build hardcoded
/ui/as its base path, so serving Tiled behind areverse-proxy prefix meant rebuilding the frontend.
Now one build serves any prefix:
<base href="/ui/" />.<base>per request from the ASGIroot_path.document.baseURI.the tag is missing and serves the file unmodified, so vendored UIs work.
api_urlfrom ui settings.Breaking:
TILED_BUILD_PUBLIC_PATHis ignored. Setuvicorn.root_path(or passroot_pathto your ASGI server) instead.Docs:
user-guide/serve-behind-reverse-proxy.md.🤖 Generated with Claude Code
This is part 2 of 2 in a stack made with GitButler: