server {
    listen 8080;
    root /usr/share/nginx/html;
    index resume.html;

    # Enhanced Content-Security-Policy
    add_header Content-Security-Policy "
        default-src 'none';
        script-src 'self' https://matomo.nixc.us;
        style-src 'self';  # Removed 'unsafe-inline' if possible by moving inline styles to external
        img-src 'self' https://matomo.nixc.us;
        frame-ancestors 'self';
        base-uri 'self';
        form-action 'self';
    ";

    # Security Headers
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;
    add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;

    # Optional Cross-Origin Headers
    add_header Cross-Origin-Embedder-Policy "require-corp" always;
    add_header Cross-Origin-Resource-Policy "same-origin" always;
    add_header Cross-Origin-Opener-Policy "same-origin" always;

    location / {
        try_files $uri $uri/ =404;
    }
}
