跳到主要内容
Nginx

通配符证书申请与部署教程(*.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 中显式加入。

内容审核

长期从事 SSL/TLS 证书部署与 HTTPS 运维,负责本站证书选型、安装配置与故障排查内容的编写与审核。