在打印窗口把「目标」选为「另存为 PDF」即可保存,页面已带 awsgood.com 版权水印。 返回原文

www.awsgood.com

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

2026-11-09 约 1 分钟

前提

通配符证书必须使用 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 中显式加入。