首页 文章

使用Azure CDN强制HTTPS

提问于
浏览
6

我在存储帐户前使用Azure CDN . 我只想通过HTTPS提供所有服务,所以我在自定义域上设置了HTTPS并创建了一个URL重写:

HTTPS rewrite rule

但问题是我最终得到这样的URL:https://the-custom-domain/website/17/index.html

website/17/index.html 是存储帐户中的根内容,但我不知道为什么它会在文件名之前附加容器路径 . 还有静态文件的重写规则(https://blog.lifeishao.com/2017/05/24/serving-your-static-sites-with-azure-blob-and-cdn) .

知道URL重写有什么问题吗?

4 回答

  • 2

    我正在使用Azure Verizon CDN

    我做了两条规则,因为我记得每次测试后你需要等待4个小时的订单

    图像删除index.html 2继续作为图像3

    enter image description here

    enter image description here

    ===============结束第一规则==================

    enter image description here

    enter image description here

    这里是文字
    1.将HTTP重定向到HTTP
    rule - >( . *)destination https://% / $ 1

    • 删除删除index.html没有工作100%;-(
      URL重写
      2.A来源((?:[^\?] /)?)($ | \? . )-Destination - > $ 1index.html $ 2
      2.B Source((?:[^\?] /)?[^\?/ .])($ | \? . ) - 目标 - > $ 1 / index.html $ 2
  • 5

    我正在使用Azure Verizon Premium .

    在这种情况下,您可能希望将http请求重定向到https endpoints . 在这种情况下,您必须为希望此行为的每个 endpoints 添加一个规则:

    match condition:
    
        if Request Scheme = HTTP
    
      feature:
    
        Redirect - Code: 301, source: (.*), destination: https://%{host}/$1
    

    该回复发现于docs microsoft

  • 4

    我使用以下配置将任何请求重定向到https

    http to https - Azure CDN

    IF请求架构HTTP(功能)URL重定向代码301源( . *)目标https://% / $ 1

  • 0

    无法确认100%,但如果您进入您创建的终端,左侧有一个导航选项...设置 - >“原点” . 单击该部分,在该部分,中途向下,有协议部分 . 您可以选择http或https . 同样,不是100%确定文档很薄 . HTH戴夫

相关问题