Created
July 6, 2020 21:57
-
-
Save frabarz/c5ba465e4ee42831447df86b400af833 to your computer and use it in GitHub Desktop.
An optimal SSL configuration for nginx servers.
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
# Sources: | |
# - https://cipherli.st/ | |
# - https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html | |
# - https://haydenjames.io/nginx-tuning-tips-tls-ssl-https-ttfb-latency/ | |
ssl_protocols TLSv1.2 TLSv1.3; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH"; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_tickets off; | |
ssl_session_timeout 10m; | |
ssl_stapling on; | |
ssl_stapling_verify on; | |
resolver 8.8.8.8 8.8.4.4 valid=300s; | |
resolver_timeout 5s; | |
#add_header Strict-Transport-Security "max-age=63072000; includeSubdomains"; | |
#add_header X-Frame-Options DENY; | |
#add_header X-Content-Type-Options nosniff; | |
# Generate the DH prime with | |
# openssl dhparam -dsaparam -out /path/to/dhparam.pem 4096 | |
ssl_dhparam /path/to/dhparam.pem; | |
ssl_ecdh_curve secp384r1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment