Last active
October 18, 2021 03:38
-
-
Save masasdani/3ba868a24e6c5d97ef095fa8a21689b4 to your computer and use it in GitHub Desktop.
certbot-nginx-amazon-linux-2
This file contains 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
sudo amazon-linux-extras install epel | |
sudo yum install certbot python2-certbot-nginx | |
# nginx .conf | |
/etc/nginx/cond.d/yourdomain.conf | |
server { | |
server_name yourdomain.com; | |
location / { | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_pass http://localhost:3001; | |
} | |
listen 80; | |
} | |
sudo certbot --nginx -d yourdomain.com | |
sudo crontab -e | |
0 10 * * * /usr/bin/certbot renew --quiet |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment