azurecdn搭建https_使用Azure CDN强制HTTPS

在Azure CDN前配置了一个Storage Account,目标是通过HTTPS提供所有内容。作者遇到的问题是URL中出现了容器路径,如'https://the-custom-domain/website/17/index.html'。为了解决这个问题,尝试了URL重写规则,但未成功。解决方案包括使用Azure Verizon Premium CDN,并设置两个规则,确保HTTP重定向到HTTPS,并修正URL中不必要的路径部分。
摘要由CSDN通过智能技术生成

bd96500e110b49cbb3cd949968f18be7.png

I’m using Azure CDN in front of a Storage Account. I’m wanting to serve everything via HTTPS only, so I’ve setup HTTPS on the custom domain and created a URL rewrite:

b58230a935c54d44e65a23fcbac543ac.png

But the problem is that I end up at a URL like this:

https://the-custom-domain/website/17/index.html

The website/17/index.html is the root content within the Storage Account, but I don’t know why it’s appending the container path before the filename. There’s also rewrite rule for static files (https://blog.lifeishao.com/2017/05/24/serving-your-static-sites-with-azure-blob-and-cdn).

Any idea what’s wrong with the URL rewrite?

解决方案

I am using Azure Verizon Premium CDN.

I did two rules. The order of the rules matter. You will need to wait up to 4 hours after each test.

image remove index.html 2 continue as image 3

fd92eb2c49c060ba4214fb6701e7db20.png

CQpSO.png

=============== END FIRST RULE ==================

yZLDM.png

77fdd25d945c7e0884ffea5cd8f4535e.png

here as text

1. redirect HTTP to HTTPs

rule--> (.*) destination https://%{host}/$1

remove remove index.html did not work 100% ;-(

URL Rewrite

2.A Source ((?:[^\?]/)?)($|\?.) -Destination -> $1index.html$2

2.B Source ((?:[^\?]/)?[^\?/.]+)($|\?.) -Destination - > $1/index.html$2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值