|
http { |
|
# Prefer certain ciphersuites, to enforce Forward Secrecy and avoid known vulnerabilities. |
|
# |
|
# Forces forward secrecy in all browsers and clients that can use TLS, |
|
# but with a small exception (DES-CBC3-SHA) for IE8/XP users. |
|
# |
|
# Reference client: https://www.ssllabs.com/ssltest/analyze.html |
|
ssl_prefer_server_ciphers on; |
|
|
|
# Ciphers suggested by: https://wiki.mozilla.org/Security/Server_Side_TLS#Intermediate_compatibility_.28default.29 |
|
ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'; |
|
|
|
# Setup pre-generate a 2048 bit random parameter for DH elliptic curves. |
|
# If not created and specified, default is only 1024 bits. |
|
ssl_dhparam /usr/local/nginx/conf/.ssl/dhparam2048.pem; |
|
|
|
# Cut out the old, broken, insecure SSLv2 and SSLv3 entirely. |
|
ssl_protocols TLSv1.2 TLSv1.1 TLSv1; |
|
|
|
# optional: turn on session resumption, using a 10 min cache shared across nginx processes |
|
# as recommended by http://nginx.org/en/docs/http/configuring_https_servers.html |
|
ssl_session_cache shared:SSL:10m; |
|
ssl_session_timeout 10m; |
|
|
|
# http://nginx.org/en/docs/http/configuring_https_servers.html#optimization |
|
keepalive_timeout 70; |
|
|
|
# Buffer size of 1400 bytes fits in one MTU. |
|
# nginx 1.5.9+ ONLY |
|
ssl_buffer_size 1400; |
|
|
|
# OCSP stapling - means nginx will poll the CA for signed OCSP responses, |
|
# and send them to clients so clients don't make their own OCSP calls. |
|
# https://en.wikipedia.org/wiki/OCSP_stapling |
|
# |
|
# while the ssl_certificate above may omit the root cert if the CA is trusted, |
|
# ssl_trusted_certificate below must point to a chain of **all** certs |
|
# in the trust path - (your cert, intermediary certs, root cert) |
|
# |
|
# 8.8.8.8 and 8.8.4.4 below are Google public IPv4 DNS servers. nginx will use them to talk to the CA. |
|
ssl_stapling on; |
|
ssl_stapling_verify on; |
|
|
|
# If you can, use DNS of your hosting company rather then Google |
|
resolver 8.8.8.8 8.8.4.4 valid=86400; |
|
resolver_timeout 10; |
|
|
|
# ... |
|
# the rest of the configuration |
|
# includes of vhost configurations |
|
} |
Comments here do not create notifications, write me an email please, or comment at the article
https://filip-prochazka.com/blog/nginx-https-spdy-hsts-security.
The contact info is at https://filip-prochazka.com - thank you!