:8080 {
    root * /srv
    file_server

    handle /health {
        respond "OK" 200
    }

    # SPA-style fallback for clean URLs
    try_files {path} {path}/ {path}.html /index.html

    # Cache static assets aggressively
    @static path *.css *.js *.svg *.png *.webp *.jpg *.jpeg *.gif *.ico *.woff *.woff2
    header @static Cache-Control "public, max-age=31536000, immutable"

    # Security headers
    header {
        X-Content-Type-Options "nosniff"
        X-Frame-Options "DENY"
        Referrer-Policy "strict-origin-when-cross-origin"
    }

    encode gzip zstd
}
