首页 > 解决方案 > 对带有 www 的子域使用 Cloudflare SSL 证书

问题描述

我正在寻找为我的网站子域使用 Cloudflare Dedicated SSL 证书的解决方案。我已经购买了 10 美元/月的套餐,期望我可以使用 www 设置通配符主机名。

我希望我的子域加载 SSL 证书,并且我的域有 100 多个子域可用。我不想添加带有 www 作为主机名的每个子域,而是使用通配符格式。

阅读以下帖子后,我受到启发-

https://community.cloudflare.com/t/page-rule-forwarding-with-subdomain-and-wildcards/136977 https://community.cloudflare.com/t/subdomain-too-deep/81872

我当前的主机名是 -

.example.com, example.com, .www.example.com

我添加*.www.example.com了为子域工作,www.sub.example.com但它似乎不起作用!我认为通配符格式不正确。

我希望我的 SSL 证书适用于所有地址,如下所示。-

example.com
www.example.com
sub1.example.com
www.sub2.example.com
sub2.example.com
www.sub2.example.com

如果 Cloudflare 真的有可能,我很困惑!

谢谢您的帮助!

标签: sslcdncloudflare

解决方案


正如Cloudflare 支持文章中所述

具有自定义主机名的专用证书可以涵盖其他级别的子域(例如: test.dev.www.example.com 而不仅仅是www.example.com

因此,您应该能够创建一个涵盖 的专用证书 example.com *.example.com *.sub1.example.com *.sub2.example.com,它应该适用于:

example.com
www.example.com
foo.example.com
www.sub1.example.com
bar.sub1.example.com
baz.sub2.example.com
www.sub2.example.com
[...] 

等等。在您的消息中,您提到添加*.www.example.com到证书以覆盖子域,例如www.sub.example.com- 但这看起来不正确,因为您需要*.sub.example.com添加。


推荐阅读