【发布时间】:2016-06-10 15:55:06
【问题描述】:
我正在尝试使用自定义域名创建应用程序网关,但一直收到错误消息“无法指定域名标签”。
我想知道是我做错了什么还是 azure 应用程序网关无法拥有自定义域名?
【问题讨论】:
标签: azure azure-application-gateway
我正在尝试使用自定义域名创建应用程序网关,但一直收到错误消息“无法指定域名标签”。
我想知道是我做错了什么还是 azure 应用程序网关无法拥有自定义域名?
【问题讨论】:
标签: azure azure-application-gateway
以下是我在 azure 应用程序网关方面的经验教训:
1.) Application gateway does _not_ support statically addressed public IPs
2.) Application gateway does _not_ support public IPs with a DNS name (e.g. somename.cloudapp.net)
3.) The application gateway’s DNS name _should_ be used to create a CNAME record which points to a friendly DNS (i.e. myawesomesite.com)
4.) The use of an A-record is _not_ recommended because the VIP may change on restart of the application gateway
运行此 powershell 脚本以获取网关 DNS:
Login-AzureRmAccount
Set-AzureRmContext -SubscriptionName '<Azure Subscription Name>'
$resourceGroup = 'myresourcegroup'
$pubIpName = 'mypubip'
Get-AzureRmPublicIpAddress -ResourceGroupName $resourceGroup -Name $pubIpName
在上面脚本返回的内容中寻找类似的内容:
DnsSettingsText: {
"Fqdn": "00000000-1111-2222-3333-444444444444.cloudapp.net"
}
您将使用 fqdn 来设置您的 CNAME。
【讨论】:
不支持,您无法设置自定义 DNS 名称,我已向 microsoft 支持部门开票。
您将拥有一个 DNS 名称,例如:12-232-4-334-2-34-2343.cloudapp.net,例如,您可以使用 CNAME,使 www.web.com 转到 12-232-4 -334-2-34-2343.cloudapp.net .
PD:另外,公共 IP 必须是动态的,仅供参考。
【讨论】:
如果您只有一个应用程序在应用程序网关上侦听,请在 Web 应用程序的自定义域中添加自定义 URL(您希望将其作为自定义域附加到网关,例如 customurl.example.com)。添加后,添加一个 DNS 条目,以便此自定义 URL (customurl.example.com) 指向您的应用程序网关的 DNS 名称 (something.cloupapp.net)。这样,当您点击自定义 URL (customurl.example.com) 时,它将通过应用程序网关重定向到您的应用程序。
【讨论】: