询问关于 acme 自动颁发和续订 ssl 证书的问题

67 天前
 victimsss
目前的是阿里云服务器,自己的所有服务都是 nginx 代理。
1 、假如通过 4) DNS API mode ( https://github.com/acmesh-official/acme.sh/wiki/How-to-issue-a-cert ) 方法申请的证书,然后通过 acme.sh --install-cert -d example.com \
--key-file /path/to/keyfile/in/nginx/key.pem \
--fullchain-file /path/to/fullchain/nginx/cert.pem \
--reloadcmd "service nginx force-reload" 进行安装,这样它是不是会自动配置 nginx.conf ,假如原来的 server 块 example.com 是手动配置,进行上面的操作只是检索并替换 key-file 和 fullchain-file 的文件路径吗。
2 、关于自动续订,acme 的 自动续订指的是更新 ~/.acme.sh/ 目录下的证书,还是说它也会记录之前的安装记录并更新,比如更新 nginx 的配置文件,或者说 copy 到 /path/to/keyfile/in/nginx/ 并 reload 。
1143 次点击
所在节点    程序员
6 条回复
titanium98118
67 天前
1 、acme 只是把证书文件复制到/path/to/keyfile/in/nginx/,并不会改动 nginx.conf
2 、同上,acme 不会对 nginx.conf 作出任何改动,只是把更新后的证书 copy 到 /path/to/keyfile/in/nginx/ 并 reload
victimsss
67 天前
@titanium98118
感谢解答,符合预期。😊
gearfox
67 天前
@titanium98118 你好,刚好借这个主题我想咨询一个问题。
一共有 3 个阿里云 ECS 服务器,第一个用 nginx 做的负载均衡,其他两个做 webserver 。现在想使用 certbot 直接在负载均衡 nginx 上自动每月申请 ssl 免费证书。
但是运行 certbot 命令,提示非要指定--webroot ,如果在第一个 ECS 上面创建了 mkdir -p /usr/local/nginx/html/.well-known/acme-challenge/,但是 Let's Encrypt 自动验证访问又说 404 ,估计是访问到后端的 webserver 上了。
这个的问题该如何解决呢?
使用的命令如下
certbot certonly --webroot \
-w /usr/local/nginx/html -d work.123.com \
--nginx-server-root /usr/local/nginx/conf \
--register-unsafely-without-email \
--agree-tos \
--preferred-challenges http
pota
67 天前
@gearfox #3 用 dns mode
gearfox
67 天前
@pota 好的,我去试试
defunct9
67 天前
用 lego

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1056461

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX