Security
nginx
Intermediate
Nginx Security Headers
Production-ready Nginx config block with HSTS, CSP, X-Frame-Options and more.
nginx
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
Prerequisites
- Nginx >= 1.18
Pro Tips
- → Test CSP with report-only first before enforcing.
- → Use securityheaders.com to validate.
Commercial Licensing
Acquire a production access token or template license for enterprise deployment.
Module Info
- Language
- nginx
- Level
- Intermediate
- Read time
- 3 min
- Published
- Jan 2025
- License
- Commercial License
Newsletter
New modules every week, directly to your inbox.
Similar Modules
TOTP Two-Factor Auth
Generate and verify time-based one-time passwords (TOTP) compatible with Google Authenticator.
python
·
Advanced
Express CSRF Protection with Double Submit
Implement double-submit CSRF protection in Express without server-side session storage.
javascript
·
Intermediate
ClamAV Malware Scanner Cron
Run ClamAV on upload directory and quarantine infected files automatically.
bash
·
Advanced