Created
February 18, 2015 15:54
-
-
Save ilyabrin/c5afe9e25f6bcdbd4d7c to your computer and use it in GitHub Desktop.
NGINX - SSL Config (ssllabs.com rate like A+)
This file contains hidden or 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
| listen 443 ssl spdy; | |
| ssl on; | |
| ssl_protocols TLSv1.2 TLSv1.1 TLSv1; | |
| ssl_session_cache shared:SSL:20m; | |
| ssl_session_timeout 10m; | |
| ssl_ciphers 'EECDH+ECDSA+AESGCM:AES128+EECDH:AES128+EDH:!RC4:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!CAMELLIA:!ADH'; | |
| ssl_prefer_server_ciphers on; | |
| resolver 8.8.8.8 8.8.4.4 valid=300s; | |
| resolver_timeout 10s; | |
| add_header X-Frame-Options "DENY"; | |
| # ERR_BLOCKED_BY_CLIENT для сайтов, которые используют загрузку контента в фреймы | |
| # чтобы разрешить загрузку в фреймах | |
| # add_header X-Frame-Options "SAMEORIGIN"; | |
| add_header X-Content-Type-Options "nosniff"; | |
| add_header Strict-Transport-Security "max-age=31536000"; | |
| add_header Public-Key-Pins 'pin-sha256="[SOME_BASE64]"; max-age=5184000;'; #[SOME_BASE64] надо выставлять свое, гуглить как считать Public-Key-Pins | |
| ssl_stapling on; | |
| ssl_trusted_certificate /etc/nginx/ssl/[SITE]/trustchain.pem; | |
| ssl_certificate /etc/nginx/ssl/[SITE]/server.crt; | |
| ssl_certificate_key /etc/nginx/ssl/[SITE]/server.key; | |
| ssl_dhparam /etc/nginx/ssl/[SITE]/dh.pem; #openssl dhparam 2048 -out dh.pem |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment