# Caddyfile of the self-host stack (deploy/selfhost). Mounted over the one baked in the web # image (docker/Caddyfile), which stays untouched. # # Differences with docker/Caddyfile: the site address comes from SITE_ADDRESS (`:80` for # plain HTTP, a domain name for automatic HTTPS), no Prometheus listener. # The credential redaction is the same: keep it in sync with docker/Caddyfile and # docs/features/log-redaction.md. (redact_log) { request>headers>X-Api-Key replace REDACTED request>headers>Authorization replace REDACTED request>headers>Proxy-Authorization replace REDACTED request>headers>Cookie replace REDACTED resp_headers>Set-Cookie replace REDACTED request>uri regexp (/invitations/)[^/?]+|([?&](?:token|access_token|api_key)=)[^&]* ${1}${2}REDACTED } { admin off # Peers allowed to set the client IP through X-Forwarded-For. Empty trusts nobody. servers { trusted_proxies static {$TRUSTED_PROXIES} } log { format filter { wrap json fields { import redact_log } } } } {$SITE_ADDRESS::80} { root * /srv file_server handle /api/* { # Overwrites the client IP headers with the TCP peer (or the address forwarded by a # TRUSTED_PROXIES peer), so nothing a client sends survives. reverse_proxy api:3000 { header_up X-Real-IP {client_ip} header_up X-Forwarded-For {client_ip} header_up X-Forwarded-Proto {scheme} header_up -Cf-Connecting-Ip } } # SPA fallback handle { try_files {path} /index.html } header { X-Content-Type-Options nosniff X-Frame-Options DENY X-XSS-Protection "1; mode=block" Referrer-Policy strict-origin-when-cross-origin -Server } encode gzip zstd log { output stdout format filter { wrap json fields { import redact_log } } } }