在CentOs8 和 nginx 下使用Let's Encrypt 並自動更新憑證 2024-02-27 12:31:59
CentOs7 和 8的指令不一樣
這裡的環境是用CentOs8 和 nginx 架設的環境
步驟為下:
1.安裝套件
dnf install epel-release
dnf install certbot python3-certbot-nginx
2.產生憑證
certbot --nginx -d www.your_domain
3.自動更新 (每月一次)
certbot renew --dry-run
crontab -e
0 0 1 * * /usr/bin/certbot renew --quiet
參考資料
https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-centos-8https://yangsheep.art/know-how/5754/