The web UI only works at the root of a site. Behind a reverse proxy at a path such as https://example.com/jellymove/, the page loads but stays blank:
index.html loads its script from /assets/index-….js, which is the site root, not /jellymove/assets/. That request never reaches the proxy's /jellymove/ location.
The UI calls the API at /api/... and opens the live event stream at /api/events, both from the root (ui/src/lib/api.ts, ui/src/lib/moves.svelte.ts).
A subdomain avoids this but isn't always possible, for example on a shared VPS where the only option is a path on an existing site.
Proposal
Make every URL the UI uses relative, so the same build works at / and under any path:
Set base: './' in ui/vite.config.ts so built asset URLs are relative.
Call the API as api/... and open the stream as api/events (no leading /). The SPA has no client-side routes, so relative URLs always resolve against the page's own path.
The proxy strips the prefix (proxy_pass http://127.0.0.1:PORT/; with a trailing slash), so the server needs no changes and the peer API is unaffected.
/jellymove without the trailing slash would resolve relative URLs wrongly. Document the proxy redirect for it (location = /jellymove { return 301 /jellymove/; }), or detect it in the UI.
Alternative if prefix stripping turns out to be awkward: a ui.base_path setting that makes the server mount the UI and /api under that prefix. Only do this if relative URLs aren't enough.
Done when
The UI works at / (as today) and behind nginx at /jellymove/: library, moves with live updates, trash and status.
The Vite dev server (npm --prefix ui run dev) still works.
The README has a working nginx example for a path, including proxy_buffering off; so live move updates aren't held back, and proxy_http_version 1.1.
The README says the peer must reach the agent directly, not through a proxy location that has its own login, as the peer uses the Authorization header for its token.
A test checks that the built index.html has no root-relative (/assets/…) URLs.
Notes
#8 (login page) sets a session cookie. Its Path must follow whatever path the UI is served under, so whichever lands second should check the two together.
## Problem
The web UI only works at the root of a site. Behind a reverse proxy at a path such as `https://example.com/jellymove/`, the page loads but stays blank:
- `index.html` loads its script from `/assets/index-….js`, which is the site root, not `/jellymove/assets/`. That request never reaches the proxy's `/jellymove/` location.
- The UI calls the API at `/api/...` and opens the live event stream at `/api/events`, both from the root (`ui/src/lib/api.ts`, `ui/src/lib/moves.svelte.ts`).
A subdomain avoids this but isn't always possible, for example on a shared VPS where the only option is a path on an existing site.
## Proposal
Make every URL the UI uses relative, so the same build works at `/` and under any path:
- Set `base: './'` in `ui/vite.config.ts` so built asset URLs are relative.
- Call the API as `api/...` and open the stream as `api/events` (no leading `/`). The SPA has no client-side routes, so relative URLs always resolve against the page's own path.
- The proxy strips the prefix (`proxy_pass http://127.0.0.1:PORT/;` with a trailing slash), so the server needs no changes and the peer API is unaffected.
- `/jellymove` without the trailing slash would resolve relative URLs wrongly. Document the proxy redirect for it (`location = /jellymove { return 301 /jellymove/; }`), or detect it in the UI.
Alternative if prefix stripping turns out to be awkward: a `ui.base_path` setting that makes the server mount the UI and `/api` under that prefix. Only do this if relative URLs aren't enough.
## Done when
- The UI works at `/` (as today) and behind nginx at `/jellymove/`: library, moves with live updates, trash and status.
- The Vite dev server (`npm --prefix ui run dev`) still works.
- The README has a working nginx example for a path, including `proxy_buffering off;` so live move updates aren't held back, and `proxy_http_version 1.1`.
- The README says the peer must reach the agent directly, not through a proxy location that has its own login, as the peer uses the `Authorization` header for its token.
- A test checks that the built `index.html` has no root-relative (`/assets/…`) URLs.
## Notes
#8 (login page) sets a session cookie. Its `Path` must follow whatever path the UI is served under, so whichever lands second should check the two together.
ClaudeBot
added this to the v0.3.0 milestone 2026-11-09 11:40:18 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
The web UI only works at the root of a site. Behind a reverse proxy at a path such as
https://example.com/jellymove/, the page loads but stays blank:index.htmlloads its script from/assets/index-….js, which is the site root, not/jellymove/assets/. That request never reaches the proxy's/jellymove/location./api/...and opens the live event stream at/api/events, both from the root (ui/src/lib/api.ts,ui/src/lib/moves.svelte.ts).A subdomain avoids this but isn't always possible, for example on a shared VPS where the only option is a path on an existing site.
Proposal
Make every URL the UI uses relative, so the same build works at
/and under any path:base: './'inui/vite.config.tsso built asset URLs are relative.api/...and open the stream asapi/events(no leading/). The SPA has no client-side routes, so relative URLs always resolve against the page's own path.proxy_pass http://127.0.0.1:PORT/;with a trailing slash), so the server needs no changes and the peer API is unaffected./jellymovewithout the trailing slash would resolve relative URLs wrongly. Document the proxy redirect for it (location = /jellymove { return 301 /jellymove/; }), or detect it in the UI.Alternative if prefix stripping turns out to be awkward: a
ui.base_pathsetting that makes the server mount the UI and/apiunder that prefix. Only do this if relative URLs aren't enough.Done when
/(as today) and behind nginx at/jellymove/: library, moves with live updates, trash and status.npm --prefix ui run dev) still works.proxy_buffering off;so live move updates aren't held back, andproxy_http_version 1.1.Authorizationheader for its token.index.htmlhas no root-relative (/assets/…) URLs.Notes
#8 (login page) sets a session cookie. Its
Pathmust follow whatever path the UI is served under, so whichever lands second should check the two together.