server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; # Hugo emits directory-style URLs (/legal/privacy/index.html). location / { try_files $uri $uri/ =404; } # Long-cache fingerprinted assets and images; the HTML stays fresh. location ~* \.(png|jpg|jpeg|svg|webp|woff2?|css|js)$ { expires 7d; add_header Cache-Control "public"; } error_page 404 /404.html; gzip on; gzip_types text/css application/javascript image/svg+xml application/xml; gzip_min_length 512; }