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

Caddyfile — first lines
# 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

Size
390 B (390 bytes)
MIME type
text/plain
SHA-256
0ac13c5785df54c99c38fe30f7c6aae730f4c94383a2e161137a19eca90e58d4
MD5
39e9fc3bc322781f96bd855ad76c3c23

Download from the command line

curl -L -o Caddyfile https://files.samplefiles.com/config/caddyfile/Caddyfile

Or check the download in your browser with the checksum calculator.