【问题标题】:Azure CDN for Azure static website 301 redirection configurationAzure CDN for Azure 静态网站 301 重定向配置
【发布时间】:2020-04-06 08:27:16
【问题描述】:

我在 Azure Blob 存储中配置了一个前端网站,按照下一篇文章:

https://docs.microsoft.com/en-us/azure/cdn/cdn-map-content-to-custom-domain

我已成功配置此网站以显示我的自定义域:

https://www.example.com

我现在正在寻找如何配置正确的 301 重定向:

  • http -> 301 -> https
  • example.com -> 301 -> www.example.com

我读了这个部分:https://www.itinsights.org/Static-Websites-with-Azure-Part-4/#HTTP-to-HTTPs-redirection

但在我的天蓝色门户中,我看不到任何可以推送此 xml 规则或如何从界面配置重定向规则的部分。

<rule id="1111111" platform="http-large" status="active" version="0" custid="XXXXX">
<description>HTTP to HTTPS</description>
<match.request-scheme value="http">
feature.url-redirect code="301" pattern="/XXXXXXX/staticwebsitede/(.*)" value="https://www.staticwebsite.de/$1" />
</match.request-scheme>
</rule>

编辑 根据接受的答案,我已联系 Azure 支持以查看是否可以迁移。 对于 example.com 到 www.example.com 的重定向,我使用了我的域注册的 Web 转发功能。

【问题讨论】:

    标签: azure azure-cdn


    【解决方案1】:

    that blog 开始,您需要选择具有Premium Verizon 层 的Azure CDN 才能享受Verizon rules engine 的好处。

    更多详情,您可以compare Azure CDN product features。目前,标准 Microsoft 层的 Azure CDN 还通过使用standard rules engine 支持URL redirect/rewrite

    【讨论】:

    • 如何更改定价层?我联系了 Azure 支持,但没有得到答复。我已获得 SSL 证书并且我的网站正在生产中,如何在不停机且不丢失配置的 SSL 证书的情况下管理迁移?
    • 据我所知,您只能删除您的 CDN 配置文件并使用新的定价层重新创建它。然后您可以map the temporary cdnverify subdomain 避免在 DNS 映射发生时中断。但是,我不确定是否还需要一些时间来为自定义域启用 HTTPS,也许 MS 支持有更好的方法。
    • Ps,如果回复对你原来的问题有帮助,请考虑接受。:)
    • 是的,我将等待得到答复……我已在我的域名注册中启用了网络转发重定向。因此,如果您键入 example.com,您将重定向到 https://www.example.com。剩下的问题是如果去http://www.example.com
    • 尝试检查this SO answer是否可以帮助您。
    猜你喜欢
    • 2019-01-31
    • 1970-01-01
    • 2016-10-31
    • 2014-11-15
    • 2018-12-10
    • 2019-01-18
    • 2020-10-20
    • 2020-08-02
    • 1970-01-01
    相关资源
    最近更新 更多