V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
victimsss
V2EX  ›  程序员

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

  •  
  •   victimsss · 59 天前 · 1127 次点击
    这是一个创建于 59 天前的主题,其中的信息可能已经有所发展或是发生改变。
    目前的是阿里云服务器,自己的所有服务都是 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 。
    6 条回复    2024-07-11 15:45:18 +08:00
    titanium98118
        1
    titanium98118  
       59 天前   ❤️ 2
    1 、acme 只是把证书文件复制到/path/to/keyfile/in/nginx/,并不会改动 nginx.conf
    2 、同上,acme 不会对 nginx.conf 作出任何改动,只是把更新后的证书 copy 到 /path/to/keyfile/in/nginx/ 并 reload
    victimsss
        2
    victimsss  
    OP
       59 天前
    @titanium98118
    感谢解答,符合预期。😊
    gearfox
        3
    gearfox  
       59 天前
    @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
        4
    pota  
       59 天前
    @gearfox #3 用 dns mode
    gearfox
        5
    gearfox  
       59 天前
    @pota 好的,我去试试
    defunct9
        6
    defunct9  
       58 天前
    用 lego
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2444 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 02:56 · PVG 10:56 · LAX 19:56 · JFK 22:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.