Config Files · 1 file
Sample Caddyfile File
Caddy is a web server with automatic HTTPS, configured with a Caddyfile. Our sample is realistic and valid for its tool, with fake hosts and secrets.
Caddyfile · 390 B
Caddyfile
A Caddy v2 config with automatic HTTPS, compression, a reverse proxy, static files and a redirect. All hosts, keys and secrets are fake.
CC0 · free for any use · Verified by an independent tool · Report a problem
# Sample Caddyfile — samplefiles.com
example.com {
encode zstd gzip
handle /api/* {
reverse_proxy localhost:3000
}
handle {
root * /var/www/example
file_server
}
header {
Strict-Transport-Security "max-age=31536000"
X-Content-Type-Options nosniff
}
}
www.example.com {
redir https://example.com{uri} permanent
}File details
Download from the command line
curl -L -o Caddyfile https://files.samplefiles.com/config/caddyfile/Caddyfilewget https://files.samplefiles.com/config/caddyfile/Caddyfilehttps://files.samplefiles.com/config/caddyfile/Caddyfileprintf '%s %s\n' 0ac13c5785df54c99c38fe30f7c6aae730f4c94383a2e161137a19eca90e58d4 Caddyfile | shasum -a 256 -cOr check the download in your browser with the checksum calculator.