{"name":"caddyfile-reverse-proxy","title":"Caddyfile reverse proxy","description":"A Caddyfile that reverse proxies a domain to your app with automatic HTTPS, compression and security headers, plus Docker, path and load balancing variants.","category":"deploy","updated":"2026-11-08","url":"https://sniptide.com/templates/caddyfile-reverse-proxy","files":[{"name":"Caddyfile","language":"text","content":"{\n\t# Let's Encrypt sends certificate expiry notices here.\n\temail you@example.com\n}\n\nexample.com {\n\tencode zstd gzip\n\n\treverse_proxy localhost:3000\n\n\theader {\n\t\tStrict-Transport-Security \"max-age=31536000; includeSubDomains\"\n\t\tX-Content-Type-Options nosniff\n\t\tReferrer-Policy strict-origin-when-cross-origin\n\t\t-Server\n\t}\n\n\tlog {\n\t\toutput file /var/log/caddy/example.com.log\n\t}\n}\n\nwww.example.com {\n\tredir https://example.com{uri} permanent\n}\n"}]}