如何设置Azure静态网站从裸域重定向到www
我有Azure静态网站映射到带有Godaddy的自定义域。根据Microsoft指令,我正在为https
使用Azure CDN。
如果我键入www.example.com
,这一切都很好。 但是,如果我省略www
子域,我会得到net :: err_cert_common_name_invalid
错误。
如何从裸域重定向到www
?
我尝试使用Azure CDN“规则引擎”添加永久重定向,但似乎不起作用。我还尝试在Godaddy DNS配置中添加从裸添加到www
子域,但这也不起作用。仍然遇到错误。
有人建议创建一个涵盖裸露和www子域的证书,但不确定是否可以在Azure CDN中进行。
有人知道如何在Azure中实现这一目标吗?
I have Azure static website mapped to a custom domain hosted with GoDaddy. I am using Azure CDN for https
as per Microsoft instructions.
This is all working fine if I type www.example.com
.
But if I omit www
subdomain, I get NET::ERR_CERT_COMMON_NAME_INVALID
error.
How can I redirect from naked domain to www
?
I tried using Azure CDN "rule engine" to add a permanent redirect but it does not seem to work. I also tried adding forwarding from naked to www
subdomain in GoDaddy DNS config, but that does not work either. Still getting errors.
Someone has suggested to create a certificate that covers both naked and www subdomains, but not sure if that is possible in Azure CDN.
Does anyone know how this can be accomplished in Azure?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
•在浏览裸域时遇到的错误消息, for eg: - 'example.com' is' net :: err_cert_common_name_invalid ' 在这种情况下,没有发现裸域DNS记录的现有“ A”记录,即'example.com'。虽然可能存在“ www.example.com'的“'记录”,“ mail.example.com”或“ app.example.com”,因此当您尝试浏览这些记录时,它们很容易访问,但是它们很容易访问,但是您的裸体自定义域也不可能。
因此,要解决此问题,您将不得不在您的公共DNS注册服务商中创建“ A”记录,即为您的裸露域名,即“ example.com”或通配符条目'*.example 。
。 support.microsoft.com/en-us/topic/associating-a-custom-domain-name-name-name-name-name-securing-communication-with-azure-0eeba-0eeba4ff-3432-e59a-7f7a-7f7a-0eee8c7c7c7c7cd7c11 /em>
•但是,对于以上 的同一件事,可以通过https 访问,您将必须
在Azure KeyVault中上传SSL/TLS证书并将其集成如下Microsoft文档中所述,使用Azure CDN
。另外,您需要确保诸如“*.example.com','example.com'和其他需要的通用名称已包含在该证书中。更确切地说,如果要求和生成的通配符证书在这些情况下将最有效,并且在任何情况下都可以使用。https://learn.microsoft.com/en-us/azure/cdn/cdn-custom-ssl?tabs=option-2------- eNable-https-https-https-with-your-own-your-ater-inow-contificate# TLSSSSL-CERTIFICATES
• The error message that you are encountering while browsing the naked domain, for e.g.: - ‘example.com’ is ‘ NET::ERR_CERT_COMMON_NAME_INVALID ’ which clearly resembles that there is no existing ‘A’ record found for the naked domain DNS record, i.e., ‘example.com’ in this case. While there may exist an ‘A’ record for ‘www.example.com’, ‘mail.example.com’ or ‘app.example.com’ due to which when you are trying to browse these, they are readily accessible, but the same is not possible for your naked custom domain.
Thus, to resolve this issue, you will have to
create an ‘A’ record in your public DNS registrar, i.e., GoDaddy for your naked domain, i.e., ‘example.com’ or for a wildcard entry ‘*.example.com’ so that when you are trying to directly access your custom domain name, you will be redirected to the original Azure static website.
https://support.microsoft.com/en-us/topic/associating-a-custom-domain-name-and-securing-communication-with-azure-0eeba4ff-3432-e59a-7f7a-0ee8c7cd7c11
• But, for the same thing above to be accessible over HTTPS, you will have to
upload an SSL/TLS certificate in Azure keyvault and integrate it with Azure CDN as described in the Microsoft documentation
below. Also, you need to ensure that common names like ‘*.example.com’, ‘example.com’ and others needed are already included in that certificate. To be more precise, a wildcard certificate if requested and generated will work best in these scenarios and be of use in all circumstances.https://learn.microsoft.com/en-us/azure/cdn/cdn-custom-ssl?tabs=option-2-enable-https-with-your-own-certificate#tlsssl-certificates