在流量管理器和 Web 应用程序上配置自定义域 [英] Configuring custom domain on traffic manager and web app

查看:14
本文介绍了在流量管理器和 Web 应用程序上配置自定义域的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我引用了这个 microsoft 文档,但它令人困惑.

解决方案

对文章中的混淆表示歉意.我们将对其进行更新以使步骤更清晰,但与此同时,希望以下信息对您有所帮助.

创建 Azure Web 应用时,该应用将拥有自己的 DNS 名称 .azurewebsites.net.如果您有多个 Web 应用程序,每个应用程序都将获得自己的 DNS 名称.我们称它们为端点 DNS 名称.

Azure 流量管理器可用于引导这些端点之间的流量(例如,您在不同的 Azure 区域拥有网站,并希望将流量发送到用户延迟最低的位置).为此,您首先创建一个流量管理器配置文件并将这些端点 DNS 名称添加为端点.此流量管理器配置文件还带有自己的 DNS 名称 .trafficmanager.net.当您将网站端点添加到流量管理器配置文件时,该流量管理器 DNS 名称将添加到 Web 应用程序支持的自定义主机名列表中.这意味着,如果有人使用流量管理器 DNS 名称(他们应该使用它来获得流量路由优势)导航到您的网站,网络应用程序将正确响应.

如果您想在分发给最终用户的 URL 中添加您自己的品牌,您可以使用 www.contoso.com 之类的虚域名并将其托管在 Azure DNS 等 DNS 托管服务中.您需要在此处执行的操作是将 CNAME 记录添加到您的 contoso.com 区域,以将其指向流量管理器 DNS 名称.一个例子是

www.contoso.com.60 IN CNAME contosotm.trafficmanager.net.

执行此操作时,对 www.contoso.com 的任何请求都将被重定向到流量管理器 DNS 名称,然后该名称将选择一个 Web 应用 DNS 名称并将其返回给调用者以进行连接.为了使其正常工作,您需要确保已将 www.contoso.com 添加到每个 Web 应用的自定义域列表中.

I refferred this microsoft doc, but it's confusing as mad.

https://docs.microsoft.com/en-us/azure/app-service/web-sites-traffic-manager-custom-domain-name

First they explain www.contoso.com will be the CNAME for <myapp>.trafficmanager.net. Then when web apps comes to picture they say www.contoso.com will be the CNAME for web app. They don't explain how both will work. When I will add hostname www.contoso.com to web app it is going to override the CNAME record for traffic manager. So next time I will hit www.contoso.com, it will go to web apps. Traffic manager went out of picture. If I will add preemptive record for traffic manager for e.g awverify.www.contoso.com CNAME to <myapp>.trafficmanager.net, what URL should I hit in browser to reach traffic manager and then to web app?

Can someone help how this whole thing works?

解决方案

apologies for the confusion in the article. We will update it to make the steps clearer, but in the meantime, hope the info below helps you.

When you create an Azure Web App, the app will have its own DNS name .azurewebsites.net. If you have multiple web apps, each will get their own DNS name. Let's call them the endpoint DNS names.

Azure Traffic Manager can be used to direct traffic between these endpoints (an example would be you have websites in different Azure regions and would like to send traffic to the lowest latency location for the user). In order to do that, you first create a Traffic Manager profile and add these endpoint DNS names as the endpoints. This Traffic Manager profile also comes with its own DNS name .trafficmanager.net. When you add websites endpoints to a Traffic Manager profile, that Traffic Manager DNS name is added to the list of custom hostnames supported by the web app. What this means is that if someone navigates to your website using the Traffic Manager DNS name (which they should use to get the traffic routing benefits), the web app will respond correctly.

If you want to add your own branding to the URL you hand out to end users, you can use a vanity domain name like www.contoso.com and host it in a DNS hosting service such as Azure DNS. What you need to do here is to add a CNAME record to your contoso.com zone to point that to the Traffic Manager DNS name. An example would be

www.contoso.com. 60 IN CNAME contosotm.trafficmanager.net.

When you do this, any requests to www.contoso.com will be redirected to the Traffic Manager DNS name which will then pick a web app DNS name and give it back to the caller to connect to. In order for this to work, you need to make sure that you have added www.contoso.com to the custom domain list of each of the web apps.

这篇关于在流量管理器和 Web 应用程序上配置自定义域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆