【问题标题】:Adding a custom domain name (NOT a subdomain) to a static site hosted on Azure Storage将自定义域名(不是子域)添加到托管在 Azure 存储上的静态站点
【发布时间】:2023-03-09 08:41:01
【问题描述】:

我有一个通过 GoDaddy 注册的域。

目前有一条A记录在哪里:

  • 主持人:@
  • 指向:IP 地址

这是指向当前正在为该站点提供服务的服务器。

我在 Azure 存储静态 web blob 中也有该站点,并且端点正在为该站点提供服务,一切都很好。

我尝试通过“asverify”方法注册一个自定义域(见下文),Azure 报告它可以工作。 我的自定义域“example.com”被接受并且一切正常除了导航到https://example.com 永远不起作用(在禁用上面的 A 记录之后)。

Create a CNAME record with your DNS provider that points from the "asverify" subdomain (like asverify.www.contoso.com) to asverify.staticweb.blob.core.windows.net or asverify.staticweb.z5.web.core.windows.net. After this step completes, enter your domain below (exclude the 'asverify' subdomain). This method does not incur any downtime. To use this method, select the 'Use indirect CNAME validation' checkbox.

我以前用 AppServices 做过类似的事情。我有另一个域已添加到不是子域的 AppService(所以它是 https://anotherexample.com 不是 https://www.anotherexample.com)。这是通过将 TXT 记录添加到 GoDaddy 的 DNS 来完成的,并且运行良好。

Azure 存储是否允许您使用非子域执行此操作?这是我想要访问该网站的唯一方式。

【问题讨论】:

    标签: azure dns azure-storage


    【解决方案1】:

    Azure 存储是否允许您使用非子域执行此操作?

    很遗憾,Azure 存储不允许您使用非子域来执行此操作。 需要子域,不支持根域。

    请看:here

    【讨论】:

      【解决方案2】:

      虽然 Azure 存储不允许它,如其他 anwser 所述。你可以很容易地在它前面放置一个 Azure CDN。要从门户执行此操作,只需转到存储资源并搜索 Azure CDN 刀片。从那里您可以创建一个指向存储或其静态网站的端点。创建端点后,您可以转到资源并使用 Custom Domain 刀片使用 CNAME 记录进行设置。

      【讨论】:

      • 我确实试过了。我可以让子域在 CDN 上工作,但不能在根域上工作。例如,在 GoDaddy DNS 中,我可以输入指向端点的 cdnverify 的 CNAME,它会将其选为 cdnverify.example.com。不过,我似乎无法引用根域。我尝试了“@”无济于事,“example.com”也不起作用。
      • @CodeWarrior 你确定你在 CNAME 的两个端点上都使用了cdnverify 子域吗?
      猜你喜欢
      • 2017-05-22
      • 1970-01-01
      • 1970-01-01
      • 2019-04-23
      • 2020-07-24
      • 2017-01-20
      • 2020-08-20
      • 2017-03-23
      • 2022-01-20
      相关资源
      最近更新 更多