Last active
March 18, 2021 06:28
-
-
Save HarshadRanganathan/9e6cf316239ccc9d8386999780c03ae4 to your computer and use it in GitHub Desktop.
Let's Encrypt SSL for Nginx in Amazon Linux AMI instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install wget | |
yum install wget -y | |
# Install certbot-auto | |
wget https://dl.eff.org/certbot-auto | |
chmod a+x certbot-auto | |
# Obtain SSL certificate with Nginx plugin for the domain | |
sudo ./certbot-auto --nginx -d app.com --debug | |
# Test SSL configuration | |
https://www.ssllabs.com/ssltest/analyze.html?d=app.com | |
# Configure cron job for SSL auto-renewal | |
sudo crontab -e | |
# Add below lines in crontab to check for certificate renewals periodically | |
PATH = /home/ec2-user/:/usr/local/sbin:/usr/local/bin:/bin:/usr/sbin:/usr/bin | |
0 6 * * * certbot-auto renew --text >> /home/ec2-user/certbot-cron.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Getting this: