Created
September 14, 2018 08:59
-
-
Save 1c7/f42b155581d4be0d158d9017e8b6509c to your computer and use it in GitHub Desktop.
Nginx Safety Checklist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# For Safety | |
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; | |
add_header Content-Security-Policy "default-src https: data: 'unsafe-inline' 'unsafe-eval'" always; | |
add_header X-Frame-Options "SAMEORIGIN" always; | |
add_header X-Xss-Protection "1; mode=block" always; | |
add_header X-Content-Type-Options "nosniff" always; | |
server_tokens off; | |
add_header Referrer-Policy "no-referrer-when-downgrade"; | |
add_header Feature-Policy "midi none;notifications none;push none;sync-xhr none;microphone none;camera none;magnetometer none;gyroscope none;speaker self;vibrate none;fullscreen self;payment none;"; | |
# Sources: | |
# https://scotthelme.co.uk/hardening-your-http-response-headers/#x-frame-options | |
# https://fearby.com/article/set-up-feature-policy-referrer-policy-and-content-security-policy-headers-in-nginx/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment