Relationships
#4509 swamp dashboard: trusted-host / bind option so it can be reached through a reverse proxy
Opened by kneel · 11/7/2026· Shipped 11/8/2026
Problem
swamp dashboard binds 127.0.0.1 only and validates the HTTP Host header
(DNS-rebind protection), returning 421 Misdirected Request for any Host that
is not loopback. There is no flag to change either behaviour (--help shows
only --no-browser).
That makes the dashboard unreachable through a reverse proxy. Concretely, with
tailscale serve fronting the dashboard on a private tailnet, the proxy forwards
the real Host (<machine>.<tailnet>.ts.net) and the dashboard answers 421.
swamp serve is not an alternative: its root is the API/websocket server
({"status":"ok","version":"1"}), not the dashboard UI.
The only workaround today is an SSH port-forward (so the dashboard sees
Host: localhost), which defeats the point of having a proxy and is awkward for
viewing the dashboard from a phone or another device on a trusted tailnet.
Desired
An explicit, opt-in way to let the dashboard sit behind a trusted proxy. Any of:
--host <addr>to bind a non-loopback interface (mirrorsswamp serve --host);--trusted-host <name>(repeatable) and/or an env var to add Host values the dashboard accepts, instead of rejecting with 421;- a flag to disable the Host check for a run.
Keep loopback + Host-lock the default (the DNS-rebind protection is good). This is strictly an opt-in for a trusted-network reverse-proxy setup.
Use case
Viewing the Agent sessions dashboard over a private Tailscale tailnet from a
second device, without an SSH port-forward, by putting tailscale serve (or
caddy/nginx) in front of it.
Environment
- swamp 20261106.012700.0-sha.ebf04ac6, Linux
- Repro:
swamp dashboard --no-browser, thencurl -H 'Host: [HOST-1]' http://127.0.0.1:<port>/->421.
Shipped
Click a lifecycle step above to view its details.