user nginx; worker_processes auto; error_log /dev/null crit; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; access_log off; sendfile on; tcp_nopush on; gzip on; server_tokens off; include /etc/nginx/conf.d/*.conf; keepalive_timeout 65; ### HTTP headers # TCP Keep-Alive add_header Connection "Keep-Alive" always; # CSP add_header Content-Security-Policy "default-src 'none'; child-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; form-action 'self'; font-src 'self'; frame-ancestors 'self'; base-uri 'self'; connect-src 'self'; img-src 'self'; manifest-src 'self'" always; # Enable cross-site filter (XSS) and tell browser to block detected attacks add_header X-XSS-Protection "1; mode=block" always; # Prevent some browsers from MIME-sniffing a response away from the declared Content-Type add_header X-Content-Type-Options "nosniff" always; # Disallow the site to be rendered within a frame (clickjacking protection) add_header X-Frame-Options "SAMEORIGIN" always; # Disable some features add_header Permissions-Policy "accelerometer=(),ambient-light-sensor=(),autoplay=(),camera=(),encrypted-media=(),focus-without-user-activation=(),geolocation=(),gyroscope=(),magnetometer=(),microphone=(),midi=(),payment=(),picture-in-picture=(),speaker=(),sync-xhr=(),usb=(),vr=(),interest-cohort=()" always; # Disable referrer add_header Referrer-Policy "no-referrer" always; # Cache control policy add_header Cache-Control "max-age=15552000" always; }