You will learn#
- how to give Vukem Video a public
httpsaddress with Caddy; - the three settings the server needs to trust the proxy;
- how to check it.
The idea#
Network mode requires TLS. You can give the server a certificate directly (TLS_CERT_FILE and TLS_KEY_FILE), or put a reverse proxy in front. The recommended proxy is Caddy: it gets and renews certificates by itself. The product documents Caddy only.
The server accepts a request as https only when the request comes from an address in TRUSTED_PROXIES, TRUST_FORWARDED_PROTO is true and the proxy sent X-Forwarded-Proto: https. A request that claims http through that header is refused, whoever sends it.
Quick start#
A Caddyfile for a server on the same machine as Vukem Video:
video.example.com {
reverse_proxy 127.0.0.1:7878
}Caddy sends X-Forwarded-Proto and the client address on its own. Start Vukem Video with:
export VUKEM_VIDEO_MODE=network
export VUKEM_VIDEO_ADDR=127.0.0.1:7878
export APP_URL=https://video.example.com
export APP_KEY="$(cat /etc/vukem-video/app-key)"
export TRUSTED_PROXIES=127.0.0.1
export TRUST_FORWARDED_PROTO=true
vukem-video serveAPP_URLis the address people type. TheHostand theOriginof every request must equal it.TRUSTED_PROXIESlists the addresses or ranges of the proxy, as the server sees them. If Caddy runs in another container, give that network's range, such as172.18.0.0/16.- With the proxy on the same machine, bind the server to loopback so only Caddy can reach it. In a container, publish
127.0.0.1:7878:7878and setAPP_URLto the public address.
Check the address, then the health route:
curl -fsS https://video.example.com/upCommon mistakes#
- Forgetting
TRUSTED_PROXIES: every client then shares one rate-limit address, and the server logs a warning. Behind a proxy, the failed-login limit would lock everyone out at once. - An
APP_URLwithhttpand a public name: refused at start-up. The plain-HTTP exception is onlylocalhostor127.0.0.1. - Letting the proxy rewrite the
Hostheader. Keep the default, which forwards the original host. - Using another web server. Only Caddy is documented and tested.