虽然是针对nginx设计的脚本,
不管你是否安装了nginx,不影响使用,只要80端口没有被占用
忽略nginx警告即可,如果你不使用nginx
首次申请
curl -sS -O https://raw.githubusercontent.com/woniu336/open_shell/main/ip-cert-apply.sh && chmod +x ip-cert-apply.sh && ./ip-cert-apply.sh
成功提示:
检测证书申请结果...
✓ 证书申请成功!
证书文件: /root/lego/certificates/3.3.3.3.crt
私钥文件: /root/lego/certificates/3.3.3.3.key
复制证书到nginx目录...
✓ 证书已复制到 /etc/nginx/ssl/ip
重新启动nginx服务...
警告: nginx启动失败
=== 证书申请完成 ===
公网IP: 3.3.3.3
证书文件: /etc/nginx/ssl/ip/3.3.3.3.crt
私钥文件: /etc/nginx/ssl/ip/3.3.3.3.key
如果遇到什么错误,重启docker容器
sudo systemctl restart docker
续期脚本
curl -sS -O https://raw.githubusercontent.com/woniu336/open_shell/main/ip-renew.sh && chmod +x ip-renew.sh && ./ip-renew.sh
提示
执行证书续期...
[3.3.3.3] acme: renewalInfo endpoint indicates that renewal is not needed
[3.3.3.3] The certificate expires in 6 days, the number of days defined to perform the renewal is 2: no
✓ 证书续期成功!
更新nginx证书文件...
✓ 证书文件已更新
提示:不需要续订,证书6天后到期
因为你才刚申请证书,还没到期
定时任务
(crontab -l 2>/dev/null; echo "5 3 * * * /root/ip-renew.sh >/root/lego-renew.log 2>&1") | crontab -
查看定时任务
crontab -l
网络问题,时不时会这样
你卡了吧,有的时候网站卡,
奇怪,我怎么看见有东西在飘过
不是的,之前遇到过,像是触发了什么关键词
有关键字审查
@路飞他哥 #4
估计是触发了cloudflare的command inject waf,可以私信我IP,确认如果是这样关掉对应的规则
@酒神 #6 我删除了一段定时任务的设置就可以了
给你点个赞,收藏了
有nginx,80端口有网站在用,这种情况申请不到吗?需要先把网站停了吗

@raingp #9 申请很快的,成功后会重启nginx