配置 Nginx SSL 证书

前期准备

yum remove epel-release
yum clean all

yum -y install yum-utils

yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional

安装 certbot 以及 certbot nginx 插件

yum install certbot python2-certbot-nginx -y

执行配置,中途会询问你的邮箱,如实填写即可

certbot --nginx

手动续约

service nginx stop
certbot --force-renewal

开放80和443端口

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --reload

开放多个端口

firewall-cmd --zone=public --add-port=80-85/tcp --permanent
# nginx  https 

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×