Caddy and HTTPS
Publish the master server and this documentation behind Caddy
Caddy terminates TLS, obtains certificates automatically, and forwards traffic to the application or serves static files.
Layout
- The main domain proxies to the application container.
- Static sites, such as this documentation, are served from
/var/www.
Safe changes
- Copy
/etc/caddy/Caddyfileto a dated backup. - Edit the file.
- Run
caddy validate --config /etc/caddy/Caddyfile. - Reload with
systemctl reload caddy.
docs.example.org {
root * /var/www/docs
encode gzip
try_files {path} {path}.html
file_server
}Always validate before reloading. A broken file takes every site on the server offline.