Azure CDN - 没有 www 的自定义主机名不起作用(NameCheap)

Azure CDN - Custom hostname without www not working (NameCheap)

我正在尝试将不带 www 的自定义域添加到 Azure CDN 服务。

有了 www,它工作得很好。但是没有 www 我得到一个错误(见第一张图片)

如有任何帮助,我将不胜感激。

参考RFC 1912 - Section 2,4

A CNAME record is not allowed to coexist with any other data. In other words, if suzy.podunk.xx is an alias for sue.podunk.xx, you can't also have an MX record for suzy.podunk.edu, or an A record, or even a TXT record.

a CNAME 不能在域的顶点(又名根)使用,因此我们不能将根域的 CNAME 记录用作 CDN 配置文件中的自定义域.

作为解决方法,将 CNAME cdnverify.<yourdomain> 设置为 cdnverify.<endpoint>.azureedge.net。验证并设置所有内容后(包括 SSL provisioning if desired), delete the CNAME and use ANAME for the root record. Read this blog 以获取更多详细信息。

官方推荐的方法是在Azure DNS中创建别名记录。请参阅 Point zone apex to Azure CDN endpoints. If so, you will delegate DNS zones with Azure DNS and configure alias records 了解您的 CDN 配置文件。

编辑

请注意

Pointing a zone apex to CDN endpoints for Azure CDN from Akamai is currently not supported.

如果您使用的是 Akamai 的 Azure CDN,您可以更改为使用其他 CDN 层。