← All Tools

Caddyfile Builder

Compose a Caddy v2 Caddyfile by clicking instead of memorizing directives. Every site block can mix reverse_proxy, file_server, redirects, custom headers, gzip / zstd encoding, basic auth, request logging, and TLS overrides. Caddy turns on automatic HTTPS by default when you use a real hostname — localhost and IPs stay HTTP unless you opt in.

Global options

Sites

Generated Caddyfile


  
Validate locally with caddy validate --config Caddyfile. Reload a running server with caddy reload.

Cheat sheet

A Caddyfile is a list of site blocks. The first line of a block is an address — a hostname, :port, http://host, or a wildcard. Inside the block, directives describe what to do. Common ones: reverse_proxy <upstream>, file_server with root * /path, redir https://new.example.com{uri}, handle_path /api/* { reverse_proxy ... }, encode gzip zstd, header X-Foo "bar", basicauth { user $hashed }, and log { output file /var/log/caddy.log }. Automatic HTTPS works for real public hostnames; localhost and IPs need tls internal.