- download certbot tool:
sudo git clone https://github.com/certbot/certbot /opt/certbot
- generate certs:
sudo /opt/certbot/certbot-auto --nginx
- in the menu select domain for which you want to generate SSL certs
- in next menu select if you want
http
&&https
access to your site orhttps
exclusively
That's all, your site is now running under https.
If you want to make https connection more secure generate 4096 DHA key (could take almost 20 minutes):