Something went wrong. Try again.
🌿 Collaborative wiki on ATProto
Something went wrong. Try again.
2.0 kB · 83 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384# Installed by deploy.sh to /etc/caddy/conf.d/lichen.caddy.# Never copy this into /etc/caddy/Caddyfile directly.lichen.wiki { tls { dns cloudflare {env.CLOUDFLARE_API_TOKEN} } encode gzip # Rate limiting keys on the address Caddy appends to X-Forwarded-For, the # one hop the app can't be lied to about. Never override that header here. # Immutable blob cache (only if blobs are content-addressed / versioned) handle /blob/* { header Cache-Control "public, max-age=31536000, immutable" reverse_proxy localhost:3000 } # Static assets served from disk handle /public/* { uri strip_prefix /public root * /opt/lichen/public file_server header Cache-Control "public, max-age=31536000, immutable" } # No blanket Cache-Control: the app renders per visitor and sets its own # policy per response. Caddy appends rather than replaces, so a header here # would mark private pages publicly cacheable. handle { reverse_proxy localhost:3000 } # Override the long immutable cache on any error so a stray 404 (missing # build artifact, typo'd asset path) can't get pinned at the CDN edge. handle_errors { header Cache-Control "public, max-age=60" respond "{err.status_code} {err.status_text}" {err.status_code} }}staging.lichen.wiki { tls { dns cloudflare {env.CLOUDFLARE_API_TOKEN} } encode gzip handle /blob/* { header Cache-Control "public, max-age=31536000, immutable" reverse_proxy localhost:3001 } handle /public/* { uri strip_prefix /public root * /opt/lichen-staging/public file_server header Cache-Control "public, max-age=31536000, immutable" } # Staging is never cached anywhere, whatever the app says. handle { header Cache-Control "no-store" reverse_proxy localhost:3001 } handle_errors { header Cache-Control "public, max-age=60" respond "{err.status_code} {err.status_text}" {err.status_code} }}stats.lichen.wiki { tls { dns cloudflare {env.CLOUDFLARE_API_TOKEN} } encode gzip reverse_proxy localhost:8081}