Skip to content

Commit 738db08

Browse files
committed
Make description of URL_* options clearer wrt public URLs and reverse proxies
Closes asciinema/asciinema-server#475
1 parent b673ef7 commit 738db08

1 file changed

Lines changed: 24 additions & 6 deletions

File tree

docs/manual/server/self-hosting/configuration.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,30 @@
44

55
### Base URL
66

7-
The base URL of the server is configured with the following environment
8-
variables:
9-
10-
- `URL_HOST` - the hostname (domain) of the server, defaults to `localhost`
11-
- `URL_PORT` - the port it's accessible at, defaults to `4000`
12-
- `URL_SCHEME` - the URL scheme, defaults to `http`
7+
These variables tell the server its **public** address — the scheme, host and
8+
port that browsers use to reach it. The server uses them to generate links and
9+
the WebSocket URLs for live streaming, so they must match the address users
10+
actually connect to, not the port the container listens on internally.
11+
12+
- `URL_HOST` - the public hostname (domain), defaults to `localhost`
13+
- `URL_PORT` - the public port, defaults to `4000`
14+
- `URL_SCHEME` - the public URL scheme (`http` or `https`), defaults to `http`
15+
16+
!!! note
17+
18+
`URL_PORT` sets the port in generated URLs only; it does **not** change the
19+
port the server binds to. The server listens on `4000` inside the container
20+
by default (set `PORT` to change it) — point your reverse proxy at that
21+
port, or at the host port you map it to.
22+
23+
!!! warning "Behind a reverse proxy"
24+
25+
Set `URL_*` to the **public** address served by your proxy, not the port the
26+
container listens on. With a proxy that terminates TLS this is usually
27+
`URL_SCHEME=https` (which defaults `URL_PORT` to 443). A telltale sign of a
28+
mismatch is uploads working while live streams show as **offline** — the
29+
live-streaming WebSocket URLs (used by both the streaming CLI and viewers'
30+
browsers) are built from these values.
1331

1432
=== "HTTP"
1533

0 commit comments

Comments
 (0)