[{"data":1,"prerenderedAt":76},["ShallowReactive",2],{"hub:tools-caddy":3},{"path":4,"key":5,"title":6,"h1":7,"description":8,"crumbs":9,"blocks":17},"\u002Ftools\u002Fcaddy\u002F","tools-caddy","Caddy Guides for Serving Static Sites","Caddy","Guides for serving static sites with Caddy: automatic HTTPS across several sites, security headers in the Caddyfile, and a measured comparison with Nginx.",[10,13,16],[11,12],"Home","\u002F",[14,15],"Tools","\u002Ftools\u002F",[7,4],[18,21,23,26,35,37,57,59],{"k":19,"text":20},"p","Caddy makes HTTPS the default: write a hostname in the Caddyfile and it obtains, renews and serves a certificate with modern TLS settings. For self-hosted static sites that removes the most common source of outages, and its short configuration format removes most of the header and fallback mistakes that audits find in hand-written server configs.",{"k":19,"text":22},"The guides below take Caddy past a single site: several sites and wildcard preview subdomains on one server, testing against the staging certificate authority, persisting certificates across rebuilds, a complete security header set with a build-time CSP hash, and a load test against Nginx on identical machines.",{"k":24,"html":25},"fig","\u003Cfigure>\n\u003Csvg viewBox=\"0 0 760 191\" role=\"img\" aria-labelledby=\"hub-caddy-hero-title hub-caddy-hero-desc\" xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\">\n  \u003Ctitle id=\"hub-caddy-hero-title\">Areas covered by the Caddy guides\u003C\u002Ftitle>\n  \u003Cdesc id=\"hub-caddy-hero-desc\">Three panels. Certificates: automatic HTTPS for several sites, wildcard previews and persistent storage. Headers: HSTS, CSP and permissions in reusable snippets. Choice: throughput, memory and configuration size against Nginx.\u003C\u002Fdesc>\n  \u003Crect x=\"0\" y=\"0\" width=\"760\" height=\"191\" fill=\"#ffffff\"\u002F>\n  \u003Cg style=\"font-family:system-ui, sans-serif;font-size:12px\">\n    \u003Crect x=\"20.0\" y=\"58.0\" width=\"226.7\" height=\"117.4\" rx=\"10\" fill=\"#8ac926\" opacity=\"0.2\" stroke=\"#5a8a16\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ccircle cx=\"40.0\" cy=\"103.0\" r=\"2.5\" fill=\"#8ac926\" stroke=\"#5a8a16\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ccircle cx=\"40.0\" cy=\"125.0\" r=\"2.5\" fill=\"#8ac926\" stroke=\"#5a8a16\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ccircle cx=\"40.0\" cy=\"146.9\" r=\"2.5\" fill=\"#8ac926\" stroke=\"#5a8a16\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Crect x=\"266.7\" y=\"58.0\" width=\"226.7\" height=\"117.4\" rx=\"10\" fill=\"#1982c4\" opacity=\"0.14\" stroke=\"#1982c4\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ccircle cx=\"286.7\" cy=\"103.0\" r=\"2.5\" fill=\"#1982c4\" stroke=\"#1982c4\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ccircle cx=\"286.7\" cy=\"125.0\" r=\"2.5\" fill=\"#1982c4\" stroke=\"#1982c4\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ccircle cx=\"286.7\" cy=\"146.9\" r=\"2.5\" fill=\"#1982c4\" stroke=\"#1982c4\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Crect x=\"513.3\" y=\"58.0\" width=\"226.7\" height=\"117.4\" rx=\"10\" fill=\"#6a4c93\" opacity=\"0.14\" stroke=\"#6a4c93\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ccircle cx=\"533.3\" cy=\"103.0\" r=\"2.5\" fill=\"#6a4c93\" stroke=\"#6a4c93\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ccircle cx=\"533.3\" cy=\"125.0\" r=\"2.5\" fill=\"#6a4c93\" stroke=\"#6a4c93\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ccircle cx=\"533.3\" cy=\"146.9\" r=\"2.5\" fill=\"#6a4c93\" stroke=\"#6a4c93\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ctext x=\"380.0\" y=\"30.0\" fill=\"#1f2937\" style=\"font-size:16px;text-anchor:middle;font-weight:700\">What the Caddy guides cover\u003C\u002Ftext>\n    \u003Ctext x=\"34.0\" y=\"83.5\" fill=\"#3f6410\" style=\"font-size:13.5px;text-anchor:start;font-weight:700\">Certificates\u003C\u002Ftext>\n    \u003Ctext x=\"50.0\" y=\"107.0\" fill=\"#1f2937\" style=\"font-size:11.5px;text-anchor:start\">several sites, one server\u003C\u002Ftext>\n    \u003Ctext x=\"50.0\" y=\"129.0\" fill=\"#1f2937\" style=\"font-size:11.5px;text-anchor:start\">wildcard previews\u003C\u002Ftext>\n    \u003Ctext x=\"50.0\" y=\"150.9\" fill=\"#1f2937\" style=\"font-size:11.5px;text-anchor:start\">persistent storage\u003C\u002Ftext>\n    \u003Ctext x=\"280.7\" y=\"83.5\" fill=\"#166a9e\" style=\"font-size:13.5px;text-anchor:start;font-weight:700\">Headers\u003C\u002Ftext>\n    \u003Ctext x=\"296.7\" y=\"107.0\" fill=\"#1f2937\" style=\"font-size:11.5px;text-anchor:start\">reusable snippets\u003C\u002Ftext>\n    \u003Ctext x=\"296.7\" y=\"129.0\" fill=\"#1f2937\" style=\"font-size:11.5px;text-anchor:start\">build-time CSP hash\u003C\u002Ftext>\n    \u003Ctext x=\"296.7\" y=\"150.9\" fill=\"#1f2937\" style=\"font-size:11.5px;text-anchor:start\">tested per response\u003C\u002Ftext>\n    \u003Ctext x=\"527.3\" y=\"83.5\" fill=\"#6a4c93\" style=\"font-size:13.5px;text-anchor:start;font-weight:700\">Caddy or Nginx\u003C\u002Ftext>\n    \u003Ctext x=\"543.3\" y=\"107.0\" fill=\"#1f2937\" style=\"font-size:11.5px;text-anchor:start\">throughput and memory\u003C\u002Ftext>\n    \u003Ctext x=\"543.3\" y=\"129.0\" fill=\"#1f2937\" style=\"font-size:11.5px;text-anchor:start\">config size\u003C\u002Ftext>\n    \u003Ctext x=\"543.3\" y=\"150.9\" fill=\"#1f2937\" style=\"font-size:11.5px;text-anchor:start\">common mistakes\u003C\u002Ftext>\n  \u003C\u002Fg>\n\u003C\u002Fsvg>\n\u003Cfigcaption>Every guide was measured on the same small VM.\u003C\u002Ffigcaption>\n\u003C\u002Ffigure>",{"k":27,"h":28,"items":29},"group","Core Web Vitals Optimization for SSGs",[30],{"t":31,"u":32,"d":33,"y":34},"Precompressing Assets with Brotli and Zstd","\u002Fperformance-optimization-core-web-vitals-for-ssgs\u002Fcss-and-javascript-asset-optimization\u002Fprecompressing-assets-with-brotli-and-zstd\u002F","Precompress static site output at build time with brotli 11 and zstd 19, serve the variants from Caddy, nginx or Cloudflare, and measure the transfer saving.","How-to",{"k":24,"html":36},"\u003Cfigure>\n\u003Csvg viewBox=\"0 0 760 295\" role=\"img\" aria-labelledby=\"hub-caddy-kinds-title hub-caddy-kinds-desc\" xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\">\n  \u003Ctitle id=\"hub-caddy-kinds-title\">Number of Caddy guides of each kind\u003C\u002Ftitle>\n  \u003Cdesc id=\"hub-caddy-kinds-desc\">Vertical bars: How-tos 4, Fixes 0, Comparisons 1 and Concepts 0.\u003C\u002Fdesc>\n  \u003Crect x=\"0\" y=\"0\" width=\"760\" height=\"295\" fill=\"#ffffff\"\u002F>\n  \u003Cg style=\"font-family:system-ui, sans-serif;font-size:12px\">\n    \u003Crect x=\"80.0\" y=\"76.0\" width=\"90.0\" height=\"170.0\" rx=\"3\" fill=\"#1982c4\" opacity=\"0.3\" stroke=\"#1982c4\" style=\"stroke-width:1px\"\u002F>\n    \u003Crect x=\"250.0\" y=\"243.0\" width=\"90.0\" height=\"3.0\" rx=\"3\" fill=\"#ff595e\" opacity=\"0.3\" stroke=\"#d83b41\" style=\"stroke-width:1px\"\u002F>\n    \u003Crect x=\"420.0\" y=\"203.5\" width=\"90.0\" height=\"42.5\" rx=\"3\" fill=\"#ffca3a\" opacity=\"0.45\" stroke=\"#a97b00\" style=\"stroke-width:1px\"\u002F>\n    \u003Crect x=\"590.0\" y=\"243.0\" width=\"90.0\" height=\"3.0\" rx=\"3\" fill=\"#6a4c93\" opacity=\"0.3\" stroke=\"#6a4c93\" style=\"stroke-width:1px\"\u002F>\n    \u003Cpath d=\"M30.0 246.0 L730.0 246.0\" fill=\"none\" stroke=\"#556071\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ctext x=\"380.0\" y=\"30.0\" fill=\"#1f2937\" style=\"font-size:16px;text-anchor:middle;font-weight:700\">Caddy guides by kind\u003C\u002Ftext>\n    \u003Ctext x=\"125.0\" y=\"69.0\" fill=\"#1f2937\" style=\"font-size:12px;text-anchor:middle;font-weight:700\">4\u003C\u002Ftext>\n    \u003Ctext x=\"125.0\" y=\"264.0\" fill=\"#556071\" style=\"font-size:11.5px;text-anchor:middle\">How-tos\u003C\u002Ftext>\n    \u003Ctext x=\"295.0\" y=\"236.0\" fill=\"#b32b30\" style=\"font-size:12px;text-anchor:middle;font-weight:700\">0\u003C\u002Ftext>\n    \u003Ctext x=\"295.0\" y=\"264.0\" fill=\"#556071\" style=\"font-size:11.5px;text-anchor:middle\">Fixes\u003C\u002Ftext>\n    \u003Ctext x=\"465.0\" y=\"196.5\" fill=\"#1f2937\" style=\"font-size:12px;text-anchor:middle;font-weight:700\">1\u003C\u002Ftext>\n    \u003Ctext x=\"465.0\" y=\"264.0\" fill=\"#556071\" style=\"font-size:11.5px;text-anchor:middle\">Comparisons\u003C\u002Ftext>\n    \u003Ctext x=\"635.0\" y=\"236.0\" fill=\"#1f2937\" style=\"font-size:12px;text-anchor:middle;font-weight:700\">0\u003C\u002Ftext>\n    \u003Ctext x=\"635.0\" y=\"264.0\" fill=\"#556071\" style=\"font-size:11.5px;text-anchor:middle\">Concepts\u003C\u002Ftext>\n  \u003C\u002Fg>\n\u003C\u002Fsvg>\n\u003Cfigcaption>5 guides use Caddy in depth; each is listed below under the section it belongs to.\u003C\u002Ffigcaption>\n\u003C\u002Ffigure>",{"k":27,"h":38,"items":39},"Production-Ready Deployment & CI\u002FCD for SSGs",[40,45,49,53],{"t":41,"u":42,"d":43,"y":44},"Nginx vs Caddy for Serving Static Sites","\u002Fproduction-ready-deployment-cicd-workflows\u002Fself-hosting-static-sites\u002Fnginx-vs-caddy-for-serving-static-sites\u002F","Nginx and Caddy compared serving the same static site: throughput, latency, memory, TLS automation, config size, compression and the mistakes each one invites.","Comparison",{"t":46,"u":47,"d":48,"y":34},"Security Headers for Static Sites Served by Caddy","\u002Fproduction-ready-deployment-cicd-workflows\u002Fsecurity-headers-for-static-sites\u002Fsecurity-headers-for-static-sites-served-by-caddy\u002F","Configure HSTS, CSP, framing, referrer and permissions headers in a Caddyfile for a static site, with per-path rules, a snippet and header tests.",{"t":50,"u":51,"d":52,"y":34},"Serving a Static Site With Caddy and Automatic HTTPS","\u002Fproduction-ready-deployment-cicd-workflows\u002Fself-hosting-static-sites\u002Fserving-a-static-site-with-caddy-and-automatic-https\u002F","Run several static sites on one Caddy server with automatic certificates: DNS and ports, staging CA tests, rate limits, storage and wildcards.",{"t":54,"u":55,"d":56,"y":34},"Serving a Static Site with Caddy","\u002Fproduction-ready-deployment-cicd-workflows\u002Fself-hosting-static-sites\u002Fserving-a-static-site-with-caddy\u002F","Host a static site on Caddy with automatic HTTPS, clean URLs, precompressed files, cache tiers, security headers and per-pull-request preview subdomains.",{"k":24,"html":58},"\u003Cfigure>\n\u003Csvg viewBox=\"0 0 760 176\" role=\"img\" aria-labelledby=\"hub-caddy-topics-title hub-caddy-topics-desc\" xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\">\n  \u003Ctitle id=\"hub-caddy-topics-title\">Topics with the most Caddy guides\u003C\u002Ftitle>\n  \u003Cdesc id=\"hub-caddy-topics-desc\">Horizontal bars, largest first: Self-Hosting Static Sites on S3, Nginx and Caddy 3, CSS and JavaScript Asset Optimization 1 and Security Headers and Hardening for Static Sites 1.\u003C\u002Fdesc>\n  \u003Crect x=\"0\" y=\"0\" width=\"760\" height=\"176\" fill=\"#ffffff\"\u002F>\n  \u003Cg style=\"font-family:system-ui, sans-serif;font-size:12px\">\n    \u003Crect x=\"350.0\" y=\"65.0\" width=\"365.6\" height=\"20.0\" rx=\"3\" fill=\"#6a4c93\" opacity=\"0.3\" stroke=\"#6a4c93\" style=\"stroke-width:1px\"\u002F>\n    \u003Crect x=\"350.0\" y=\"99.0\" width=\"121.9\" height=\"20.0\" rx=\"3\" fill=\"#6a4c93\" opacity=\"0.3\" stroke=\"#6a4c93\" style=\"stroke-width:1px\"\u002F>\n    \u003Crect x=\"350.0\" y=\"133.0\" width=\"121.9\" height=\"20.0\" rx=\"3\" fill=\"#6a4c93\" opacity=\"0.3\" stroke=\"#6a4c93\" style=\"stroke-width:1px\"\u002F>\n    \u003Cpath d=\"M350.0 60.0 L350.0 158.0\" fill=\"none\" stroke=\"#556071\" style=\"stroke-width:1.5px\"\u002F>\n    \u003Ctext x=\"380.0\" y=\"30.0\" fill=\"#1f2937\" style=\"font-size:16px;text-anchor:middle;font-weight:700\">Where Caddy comes up\u003C\u002Ftext>\n    \u003Ctext x=\"20.0\" y=\"79.2\" fill=\"#1f2937\" style=\"font-size:12px;text-anchor:start\">Self-Hosting Static Sites on S3, Nginx…\u003C\u002Ftext>\n    \u003Ctext x=\"723.6\" y=\"79.5\" fill=\"#1f2937\" style=\"font-size:12px;text-anchor:start;font-weight:700\">3\u003C\u002Ftext>\n    \u003Ctext x=\"20.0\" y=\"113.2\" fill=\"#1f2937\" style=\"font-size:12px;text-anchor:start\">CSS and JavaScript Asset Optimization\u003C\u002Ftext>\n    \u003Ctext x=\"479.9\" y=\"113.5\" fill=\"#1f2937\" style=\"font-size:12px;text-anchor:start;font-weight:700\">1\u003C\u002Ftext>\n    \u003Ctext x=\"20.0\" y=\"147.2\" fill=\"#1f2937\" style=\"font-size:12px;text-anchor:start\">Security Headers and Hardening\u003C\u002Ftext>\n    \u003Ctext x=\"479.9\" y=\"147.5\" fill=\"#1f2937\" style=\"font-size:12px;text-anchor:start;font-weight:700\">1\u003C\u002Ftext>\n  \u003C\u002Fg>\n\u003C\u002Fsvg>\n\u003Cfigcaption>Topic pages give the wider context for each group; the numbers count only guides that use this tool in depth.\u003C\u002Ffigcaption>\n\u003C\u002Ffigure>",{"k":27,"h":60,"items":61},"Often used with Caddy",[62,67,72],{"t":63,"u":64,"d":65,"y":66},"nginx","\u002Ftools\u002Fnginx\u002F","Self-hosted serving, compression and cache headers.","3 shared guides",{"t":68,"u":69,"d":70,"y":71},"Eleventy","\u002Ftools\u002Feleventy\u002F","Incremental builds, image pipelines and the data cascade.","1 shared guides",{"t":73,"u":74,"d":75,"y":71},"Cloudflare","\u002Ftools\u002Fcloudflare\u002F","Pages and Workers hosting, cache rules and edge functions.",1790943190468]