1.安装 EPEL 仓库
subscription-manager repos --enable rhel-7-server-optional-rpms --enable rhel-7-server-extras-rpms
或者
yum -y install epel-release
2.Enable the optional channel
yum -y install yum-utils
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
3.安装Certbot
sudo yum install certbot python2-certbot-nginx
4.安装证书
sudo certbot --nginx --nginx-server-root=/path/to/nginx/conf
5.自动续约
# 自动续约
sudo certbot renew --dry-run
# 指定nginx配置文件路径
sudo certbot renew --nginx --nginx-server-root=/path/to/nginx/conf --dry-run
参考这里