Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure CDN - How to redirect from root domain to www? Some rules from Rules engine don't apply

Tags:

azure

I created a static page using Azure Storage and CDN with Microsoft Standard pricing tier. I need to redirect user from example.com to https://www.example.com (with www), but my rules doesn't seem to work - only http to https redirection rule works so when I type example.com I'm redirected to https://example.com

That's my rules configuration:

enter image description here

That's domain records: enter image description here

Both options are added in custom domains for this cdn: enter image description here

like image 231
Piotrek Avatar asked Jun 27 '20 16:06

Piotrek


People also ask

Can Cdn redirect?

By default, CDN will not automatically redirect HTTP requests to HTTPS. However, this can easily be configured using CDN's built-in rules engine.

What does redirect root domain mean?

This usually means setting up an A record for the root domain and a CNAME (or additional A records) for subdomains. DNS is great for "redirects" that simply point the domain to a specific host, like website or application that has a dedicated IP address and is configured to work with the domain you want to use.

What is CDN Azure?

Azure Content Delivery Network (CDN) offers developers a global solution for rapidly delivering high-bandwidth content to users by caching their content at strategically placed physical nodes across the world.


1 Answers

The problem is that at first user is forwarded to https://example.com where there is no cert and privacy error appears and rules are not applied. Rules could be changed to this:

enter image description here

so now user is forwarded from example.com to https://www.example.com, but if somebody will type https://example.com he will still see an error. Solution to this could be buy SSL cert, because Azure CDN doesn't allow CDN Managed SSL for apex domain.

like image 121
Piotrek Avatar answered Sep 24 '22 16:09

Piotrek