https://certbot.eff.org/#ubuntutrusty-other
mkdir -p /etc/letsencrypt/configs
- Create the file:
/etc/letsencrypt/configs/domain.com.conf
mkdir -p /var/www/letsencrypt/
-
Generate dhparam:
mkdir -p /etc/nginx/ssl/
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
-
Configure vhost to support letsencrypt validator:
location /.well-known {
root /var/www/letsencrypt;
}
- Reload nginx:
nginx -s reload
./certbot-auto --renew-by-default --config /etc/letsencrypt/configs/domain.com.conf certonly
- Add the following lines to
server
section:
ssl on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
ssl_prefer_server_ciphers on;
ssl_dhparam /etc/nginx/ssl/dhparams.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:50m;
ssl_stapling on;
ssl_stapling_verify on;
add_header Strict-Transport-Security max-age=15768000;
- Create the file
letsencrypt-autoupdate.sh
- Give execution permission:
chmod +x letsencrypt-autoupdate.sh
- Add to crontab:
crontab -e
0 0 1 * * /root/letsencrypt-autoupdate.sh