Skip to content

Caddy

Is a Web server Software

Setup

Usage

  • caddy reload to reload configuration
    • In /etc/caddy in the Docker image
    • Reload in place with Docker: docker exec caddy caddy reload -c /etc/caddy/Caddyfile

Caddyfile

Overall structure

web.site.net {
    respond "Hello, world!"
}

Commands

  • Return a fixed value: respond "Hello, world!"
  • Do some reverse proxying: reverse_proxy hostname:8080
  • Use a custom certificate: tls cert.pem key.pem - source
  • Define a basic authentication: see documentation on basicauth
    • Hash password with caddy hash-password -p <password>
    • With Docker, see Docker
  • Define a path within a site: use handle and handle_path (remove the path) within a configuration