nice-train-78888
08/03/2026, 5:58 AM<https://my-domain:38941/api/git/changes>
I set already OH_WEB_URL env π€modern-fireman-99755
08/03/2026, 7:36 AMOH_WEB_URL isn't used for that URL at all, it only gets added to the sandbox container's CORS allow-list.
The /api/git/changes URL is built from SANDBOX_CONTAINER_URL_PATTERN + a random host port Docker assigns fresh per sandbox. The frontend swaps localhost for your real hostname but keeps that random port as-is. Therefore, Traefik has no route for.
This is a known, still-open gap in V1 self-hosting:
- github.com/OpenHands/OpenHands/issues/13504
- github.com/OpenHands/OpenHands/issues/12581
A proper single-endpoint gateway was built but never merged:
- github.com/OpenHands/OpenHands/pull/13516
- github.com/OpenHands/OpenHands/pull/14909
Workarounds today:
- AGENT_SERVER_USE_HOST_NETWORK=true pins the agent-server to a fixed port (8000) instead of random, so you can add one static Traefik route. Only safe for one sandbox at a time, concurrent conversations would collide on the same fixed host ports.
- OH_SANDBOX_CONTAINER_URL_PATTERN=<https://my-domain>:{port} fixes the hostname, but Traefik still needs to route an arbitrary port per sandbox, some self-hosters do this with an nginx regex proxy, which isn't something Traefik supports natively.
Did this solve your problem?nice-train-78888
08/03/2026, 7:37 AMmodern-fireman-99755
08/03/2026, 7:39 AMfresh-machine-37269
08/03/2026, 7:40 AMnice-train-78888
08/03/2026, 7:40 AMfresh-machine-37269
08/03/2026, 7:45 AMopenhands/docs repo that builds docs.openhands.dev, 263 pages) and the four linked issues/PRs via the GitHub API. Here's what I found:
What's missing (verified):
β’ AGENT_SERVER_USE_HOST_NETWORK β not documented anywhere.
β’ SANDBOX_CONTAINER_URL_PATTERN / OH_SANDBOX_CONTAINER_URL_PATTERN β not documented anywhere.
β’ OH_WEB_URL is mentioned exactly once (configuration-options.mdx), described as "the externally reachable URL of your OpenHands instance." That's misleading β per the actual behavior it only adds the host to the sandbox container's CORS allow-list; it does not fix the per-sandbox /api/git/changes hostname, which is exactly the wrong assumption the user in the thread made.
β’ There is no "behind a reverse proxy / Traefik" guidance covering the random per-sandbox port that Docker assigns, and no mention that this is a known-open V1 self-hosting gap.
β’ The newer V1 self-hosting docs (agent-canvas/backend-setup/docker.mdx, vm.mdx, SELF_HOSTING.md) describe a single-ingress-port (8000) architecture that sidesteps the problem β but only for the newer Agent Canvas image path. They don't cover the older openhands/openhands Docker image self-hosting where the random-port issue bites.
Thread claims verified accurate:
β’ #13504, #12581 β closed issues (random ports / "Disconnected" on localhost)
β’ #13516 "WebSocket Gateway" β closed, not merged
β’ #14909 "OpenHands Gateway and V1 routing for self-hosted deployments" β closed, not merged
β’ So the single-endpoint gateway that would have fixed this was built but never merged; the gap is still open.
Recommendation: Add a short "Self-hosting behind a reverse proxy" section (best fit: the V1 configuration options page or a self-hosting/troubleshooting page) covering:
1. The random per-sandbox port behavior and why OH_WEB_URL doesn't fix it (CORS only).
2. The two workaround env vars with caveats: AGENT_SERVER_USE_HOST_NETWORK=true pins to port 8000 (one sandbox at a time, collisions on concurrent conversations) and OH_SANDBOX_CONTAINER_URL_PATTERN=<https://my-domain:{port}> (fixes hostname but Traefik still needs arbitrary-port routing β requires an nginx regex proxy, not natively supported by Traefik).
3. A link to the open issues so people can track the proper fix.
Want me to open a docs PR with this section?nice-train-78888
08/03/2026, 7:45 AMmodern-fireman-99755
08/03/2026, 7:47 AMCanvas is the new stuff right?Yes
modern-fireman-99755
08/03/2026, 7:49 AMAGENT_SERVER_USE_HOST_NETWORK SANDBOX_CONTAINER_URL_PATTERN / OH_SANDBOX_CONTAINER_URL_PATTERN ? Make the PR coincise and be sure every claim you do is validated against the codefresh-machine-37269
08/03/2026, 8:01 AMopenhands/docs repo that builds docs.openhands.dev, 263 pages) and the four linked issues/PRs via the GitHub API. Here's what I found:
What's missing (verified):
β’ AGENT_SERVER_USE_HOST_NETWORK β not documented anywhere.
β’ SANDBOX_CONTAINER_URL_PATTERN / OH_SANDBOX_CONTAINER_URL_PATTERN β not documented anywhere.
β’ OH_WEB_URL is mentioned exactly once (configuration-options.mdx), described as "the externally reachable URL of your OpenHands instance." That's misleading β per the actual behavior it only adds the host to the sandbox container's CORS allow-list; it does not fix the per-sandbox /api/git/changes hostname, which is exactly the wrong assumption the user in the thread made.
β’ There is no "behind a reverse proxy / Traefik" guidance covering the random per-sandbox port that Docker assigns, and no mention that this is a known-open V1 self-hosting gap.
β’ The newer V1 self-hosting docs (agent-canvas/backend-setup/docker.mdx, vm.mdx, SELF_HOSTING.md) describe a single-ingress-port (8000) architecture that sidesteps the problem β but only for the newer Agent Canvas image path. They don't cover the older openhands/openhands Docker image self-hosting where the random-port issue bites.
Thread claims verified accurate:
β’ #13504, #12581 β closed issues (random ports / "Disconnected" on localhost)
β’ #13516 "WebSocket Gateway" β closed, not merged
β’ #14909 "OpenHands Gateway and V1 routing for self-hosted deployments" β closed, not merged
β’ So the single-endpoint gateway that would have fixed this was built but never merged; the gap is still open.
Recommendation: Add a short "Self-hosting behind a reverse proxy" section (best fit: the V1 configuration options page or a self-hosting/troubleshooting page) covering:
1. The random per-sandbox port behavior and why OH_WEB_URL doesn't fix it (CORS only).
2. The two workaround env vars with caveats: AGENT_SERVER_USE_HOST_NETWORK=true pins to port 8000 (one sandbox at a time, collisions on concurrent conversations) and OH_SANDBOX_CONTAINER_URL_PATTERN=<https://my-domain:{port}> (fixes hostname but Traefik still needs arbitrary-port routing β requires an nginx regex proxy, not natively supported by Traefik).
3. A link to the open issues so people can track the proper fix.
Want me to open a docs PR with this section?fresh-machine-37269
08/03/2026, 8:21 AMAGENT_SERVER_USE_HOST_NETWORK for fixed ports, SANDBOX_CONTAINER_URL_PATTERN / OH_SANDBOX_CONTAINER_URL_PATTERN for the hostname, and a note that OH_WEB_URL doesn't fix these URLs.
Γ’Β’ The two env vars on the V1 Configuration Options page.
Sorry about getting stuck earlier Γ’ a git clone hung the terminal for a while; all sorted now. It's a draft, so happy to adjust wording. :)
This message was posted by an AI agent (OpenHands) on behalf of the maintainer.calm-artist-7206
08/03/2026, 12:52 PMβ οΈ The agent encountered a problem (status: stuck).
Yes β this is worth adding to the docs, and I verified the gap is real.
modern-fireman-99755
08/03/2026, 12:54 PM