Caddyfile Generator
Generate modern Caddy web server configurations with automated HTTPS, reverse proxy forwarding, compression, and security headers.
app.example.com {
encode gzip zstd
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Referrer-Policy "strict-origin-when-cross-origin"
}
reverse_proxy localhost:3000
}
Do it offline:$
How to use it
- Enter your target domain or hostname (e.g., api.example.com or localhost).
- Choose your server operational mode: Reverse Proxy, Static File Server, or Permanent HTTP Redirect.
- Toggle performance and security features like Gzip/Zstandard compression, HSTS, and clickjacking protection.
- Copy the generated Caddyfile configuration or download it directly to deploy alongside your Caddy binary.
Generate production-ready Caddyfile configurations with automated HTTPS, reverse proxy forwarding, static file servers, compression, and security headers.
How it works
Caddy is a modern, memory-safe web server written in Go that automatically provisions and renews TLS certificates via Let's Encrypt or ZeroSSL.
Its configuration syntax (Caddyfile) is clean, human-readable, and avoids the verbose boilerplate typical of Nginx or Apache.
The generator produces deterministic, properly formatted site blocks adhering to official Caddy v2 directive specifications.
All configuration composition runs locally inside your browser with zero telemetry or network transmission.
Examples
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
Common errors
FAQ
How does Caddy handle SSL/TLS certificates automatically?
When given a public domain name, Caddy automatically solves ACME challenges via Let's Encrypt or ZeroSSL, issues certificates, and schedules automatic renewals without external cron jobs.
Where should the Caddyfile be placed on the server?
By default on Linux systems, the Caddyfile resides at /etc/caddy/Caddyfile. For local testing, placing it in the current working directory next to the caddy binary allows running 'caddy run'.
Can I run Caddy alongside Docker containers?
Yes. Caddy's 'reverse_proxy' directive easily routes traffic to Docker container ports (e.g. reverse_proxy localhost:3000 or container_name:3000 on a shared Docker bridge network).