# Serves the static site built by Zensical (./public) for client 05.
# Mounted at /etc/nginx/conf.d/default.conf inside nginx:alpine.

server {
    listen 80;
    server_name _;

    root  /usr/share/nginx/html;
    index index.html;

    # Zensical uses directory-style URLs (/page/ -> /page/index.html).
    # Unknown paths fall through to the generated 404 page.
    error_page 404 /404.html;
    location / {
        try_files $uri $uri/ =404;
    }

    # Long-cache fingerprinted theme assets; keep HTML uncached so content
    # updates show up immediately after a rebuild.
    location /assets/ {
        expires 7d;
        add_header Cache-Control "public";
    }
    location = /404.html {
        internal;
    }

    gzip            on;
    gzip_types      text/css application/javascript application/json image/svg+xml;
    gzip_min_length 1024;
}
