Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forcing HTTPS with Azure CDN

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:

HTTPS rewrite rule

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?

like image 911
Aaron Powell Avatar asked Apr 09 '18 11:04

Aaron Powell


People also ask

How do I map a CDN content to a custom domain?

Log into the Azure Portal. Click Browse, then CDN Profiles, then the CDN profile with the endpoint you want to map to a custom domain. In the CDN Profile blade, click the CDN endpoint with which you want to associate the subdomain. At the top of the endpoint blade, click the Add Custom Domain button.

Does Azure CDN use Akamai?

Akamai (NASDAQ: AKAM), the intelligent edge platform for securing and delivering digital experiences, today announced it has integrated Akamai's content delivery network (CDN) capabilities with Microsoft Azure Media Services and Blob Storage.


1 Answers

There is an official guide from MS here, which works with standard Azure CDN:

https://docs.microsoft.com/en-us/azure/cdn/cdn-standard-rules-engine

Summary below:

Redirect users to HTTPS

  • On the CDN profile page, select the endpoint you want to create rules for.
  • Select the Rules Engine tab.
  • Select Add rule and enter a rule name.
  • To identify the type of requests the rule applies to, create a match condition:
    • Select Add condition, and then select the Request protocol match condition.
    • For Operator, select Equals.
    • For Value, select HTTP.
  • Select the action to apply to the requests that satisfy the match condition:
    • Select Add action, and then select URL redirect.
    • For Type, select Found (302).
    • For Protocol, select HTTPS.
    • Leave all other fields blank to use incoming values.
  • Select Save to save the new rule. The rule is now available to use.
like image 122
Rune Aamodt Avatar answered Oct 20 '22 16:10

Rune Aamodt