Reverse proxy
HTTPS with Caddy
Keep Trestle on loopback and let Caddy own public TLS. Trust only the loopback address that actually connects to Trestle.
trestle.example.com {
reverse_proxy 127.0.0.1:8090
}TRESTLE_LISTEN=127.0.0.1:8090
TRESTLE_TRUSTED_PROXIES=127.0.0.1/32Required behavior
- Caddy must replace, not append untrusted,
X-Forwarded-ForandX-Forwarded-Protovalues. - Do not trust broad private ranges unless every address in that range is an administered proxy.
- Leave buffering disabled for
/api/v1/realtimeso SSE events stream promptly. - Set request limits large enough for configured uploads while retaining Trestle's own endpoint limits.
- Preserve
Hostso strict origin and CSRF checks match the browser origin. - Webhook callbacks and Lambda invocation are outbound and require working DNS and HTTPS egress.
Smoke test
curl -fsS https://trestle.example.com/system/health
curl -fsS https://trestle.example.com/system/version