面向中文开发者的 AWS 实战知识库 代维服务
上云咨询

通配符证书申请与部署教程(*.example.com)

导出 PDF 浅色排版、带版权水印,可在打印窗口另存为 PDF
通配符证书申请与部署教程(*.example.com) — 通配符证书申请与部署教程(*.example.com)

前提

通配符证书必须使用 DNS-01 验证,HTTP 验证不适用。

acme.sh + DNS API 自动化

export CF_Token="xxxx"
acme.sh --issue --dns dns_cf -d example.com -d '*.example.com'
acme.sh --install-cert -d example.com 
  --key-file /etc/nginx/ssl/example.com.key 
  --fullchain-file /etc/nginx/ssl/example.com.pem 
  --reloadcmd "nginx -s reload"

部署提示

多个子域名共用一对 pem/key 即可;通配符不覆盖多级子域名,需要时在 SAN 中显式加入。