基于acme的自动重新获取ssl证书脚本的修正脚本
基于acme的自动重新获取ssl证书脚本的修正脚本
acme 是一个很棒的 let’s encrypt 的客户端
但是,当本地的 nginx 设置了强制跳转 https 时,脚本会在验证域名的时候失败。为解决这样的问题,我写了一个新的脚本修正这个问题
1 | list="example.com another.example.com" |
/etc/nginx/conf.d 是服务器配置文件夹,其中对于每一个需要申请 ssl 证书的域名的服务器配置,都需要事先准备一份备份配置,这个备份配置就是不强制跳转 https 的配置。在执行脚本申请证书时,会临时替换为正式的配置,从而避免申请失败。
最后,配置每隔三个月的定时任务即可:
1 | 0 0 1 4,7,10,1 * /path-to/this.sh > /dev/null # 表示每 4,7,10,1(隔三个月)月的 1号 00:00 执行当前脚本 |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Mosu!
评论
ArtalkGitalk

Mosu is located on the shore of Mosu Lake, facing the vast Chu Sea, backed by the Yihan Mountains. Thousands of miles of Mosu Desert can not erode the Mosu Valley. Thus the Mosu Empire was established.


