ssl - Letsencrypt + nginx + autorenewal + 基础架构即代码?

标签 ssl nginx ansible lets-encrypt ubuntu-18.04

我们的基础架构由 Ansible 管理(包括 nginx 站点配置 - 它们是使用模板生成的)。

现在我们每 3 个月通过 certbot 命令自动生成 letsencrypt 证书,但是我们有大约 1 分钟的停机时间(我们必须停止 nginx,将 certbot 绑定(bind)到 80)。

如何实现 Letsencrypt + nginx 集成自动更新?那么通配符呢?

我找到了一些解决方案,例如 How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)但他们使用修改站点配置的 python-certbot-nginx(并且他们将在下一次 Ansible 运行时被 Ansible 取代,因此 HTTPS 将被破坏)。

最佳答案

最好的选择是使用 DNS certbot 插件。

  1. 不需要绑定(bind)端口。
  2. 在创建第一个 letsencript 证书之前,您不需要为首次启动的 nginx 生成自签名证书。
  3. 通配符。

关于ssl - Letsencrypt + nginx + autorenewal + 基础架构即代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51418832/

相关文章:

magento 安全单页结帐不起作用?

python - Ansible playbook 在所有 Ubuntu 服务器上均失败

node.js - NodeJS + CouchDB : Migrate from HTTP to HTTPS

internet-explorer - IE TLS 阻止如何在 tomcat 6 和 java 6 中从 TLS 1.0 移动到 TLS 1.2

ruby-on-rails - Rails Elastic Beanstalk nginx 301 重定向

ruby-on-rails - Nginx/ unicorn : Upstream timed out (110: Connection timed out) while reading response header from upstream

html - 使用 NGINX,css 文件不工作

python - 如何在 CentOS8 上安装 Ansible

ansible - 从输出中提取值并发送到下一个任务

ssl - 关于不受信任的 SSL 证书的浏览器错误