Install Certbot: Run this command on the command line on the machine to install Certbot.
sudo yum install certbot python2-certbot-nginx
Choose how you’d like to run Certbot
Either get and install your certificates…Run this command to get a certificate and have Certbot edit your Nginx configuration automatically to serve it, turning on HTTPS access in a single step.
sudo certbot --nginx
Or, just get a certificateIf you’re feeling more conservative and would like to make the changes to your Nginx configuration by hand, run this command.
sudo certbot certonly --nginx
Set up automatic renewalWe recommend running the following line, which will add a cron job to the default crontab.
Confirm that Certbot workedTo confirm that your site is set up properly, visit https://yourwebsite.com/ in your browser and look for the lock icon in the URL bar. If you want to check that you have the top-of-the-line installation, you can head to https://www.ssllabs.com/ssltest/.