You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用Lego生成覆盖多域名变体的Let's Encrypt证书?

Answers to Your Lego/Let's Encrypt Questions

Hey there! Let me share what I know about your two questions from working with Lego and Let's Encrypt on Bitnami servers:

1. Can I use a comma-separated list of domains in the Lego command?

Absolutely! This is actually the standard way to include multiple domain variants (like your .com, .co.uk, and www subdomains) in a single Let's Encrypt certificate.

Just format the --domains flag with all your desired domains separated by commas (no spaces needed). Here's an example of what that command would look like:

sudo lego --email="your-email@example.com" --domains="example.com,www.example.com,example.co.uk,www.example.co.uk" --path="/etc/lego" run

This will generate a single certificate that covers all those domains as Subject Alternative Names (SANs), so you won't need separate certificates for each variant.

2. What's the naming rule for the .crt and .key files in /etc/lego/certificates? Will there be overly long filenames?

No need to worry about long filenames here! Lego uses the first domain you specify in the --domains list as the base name for both the certificate and key files.

For example, if your command starts with --domains="example.com,...", the files will be named:

  • example.com.crt
  • example.com.key

Even if you add 10 more domains after the first one, the filenames will still stay short and based on that initial domain. The certificate itself will include all your specified domains as SANs, but the filename doesn't reflect that—so no unwieldy, overly long names to deal with.

内容的提问来源于stack exchange,提问作者Lee Probert

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 09:51:16