Now we need to add a new snippet with ssl-params.
Go to snippets directory and create a new one.
cd /etc/nginx/snippets
nano ssl.conf
Add the following lines, save and exit the editor (Ctrl+X
, Y
, Enter
).
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_session_tickets on;
ssl_protocols TLSv1.2;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384;
ssl_ecdh_curve secp384r1;
ssl_prefer_server_ciphers on;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security "max-age=15768000; includeSubdomains; preload";
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
Then you have to create a directory for certificates snippets.
mkdir certs
cd certs
Create a new file that will hold certificate’s params.
nano example.com
Add paths to the wildcard certificate.
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/example.com/fullchain.pem;