问题
I have a concern with our CDN as we are planning to apply custom domain. I understand the part that it is not possible to map a CNAME record to a root domain, such as contoso.com. I want to ask for a workaround, let us say yes we already assigned it to www.contoso.com. But people now adays do not use the www subdomain anymore and will just type constoso.com in the URL address bar and therefore it will just return a 404 because it is not mapped making as lose potential customers. What is your suggested solution or workaround for this?
回答1:
Some DNS hosts allow creating CNAMES for root domains (ANAMES). If your DNS host doesn't allow that then you can try to use subdomain redirection (like simple node.js app hosted on azure). Not the best solution but I'm not sure if other exists.
回答2:
The work around is to use the cdnverify CNAME feature with A record.
CNAME : cdnverify.constoso.com -> cdnverify.constoso.azureedge.net
A record: constoso.com -> x.x.x.x
After all verification is complete, the CNAME can be removed. It worked for my domain.
(source: https://arlanblogs.alvarnet.com/adding-a-root-domain-to-azure-cdn-endpoint/)
回答3:
There is currently no solution for this, except the described workaround when your domain-provider supports this.
There is a feature request on Azure for this problem: https://feedback.azure.com/forums/217313-networking/suggestions/31221439-cdn-allow-root-domain-for-custom-domains
来源:https://stackoverflow.com/questions/48198859/azure-cdn-using-root-domain-solution