Last Updated: April 23, 2019
· bear

nginx ssl config with forward secrecy enabled

Two things are important for any HTTPd configuration: mitigation of BEAST and Forward Secrecy. Perfect Forward Secrecy is hard since IE9 does not support any of the DHE or ECDHE.
For details on what all that means see SSL Labs article on deploying forward secrecy. This config below scores very well with SSL Labs test suite.

server_tokens off;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_timeout 5m;

5 Responses
Add your response

I would add to your documentation how to use openssl to append the DH randomness to your key chain:

openssl dhparam -rand - 1024 >> mychain.pem

over 1 year ago ·

For the benefit of future readers: using the explicit list of ciphers from the referenced SSL Labs article only got my site an overall "C" rating in SSL Labs' own tests, whereas the following much simpler alternative gets an "A":

ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
over 1 year ago ·

Re. @rtaprh's comment, with the current stable nginx versions it's no longer necessary to do the dhparam trick, and in fact it's downright discouraged.

over 1 year ago ·

Maybe a best source of informations about that problem is :

And we can check our servers configurations with their tool :


over 1 year ago ·

Thanks for this article. Not sure how up to date it is, but you could consider taking SSLv3 out.

over 1 year ago ·