nya notes

Serving a static site with Caddy

This site is a handful of HTML files. Caddy serves them with almost no configuration:

example.com {
    root * /var/www/html
    encode zstd gzip
    file_server
}

Certificates are handled automatically. I add a custom 404 page with handle_errors and a long cache header for CSS, and that's the whole setup.

No build step, no database, nothing to patch except the OS.

← All posts