How to make HTTP to HTTPS Redirection working, with Microsoft Standard CDN

xrevo 1 Reputation point
2020-06-25T21:24:53.173+00:00

Hi,

I'm facing an issue with Azure CDN.
But before that, here is a little bit of context. I've set up :

  1. A static web site hosted on storage account (with Secure transfer required enabled),
  2. Then i linked an Azure CDN to it (pricing tier is Microsoft Standard CDN),
  3. After that, i set up a custom domain on my CDN and apply a Custom Domain HTTPS with CDN Managed certificate (like explained in this article https://learn.microsoft.com/en-us/azure/cdn/cdn-custom-ssl?tabs=option-1-default-enable-https-with-a-cdn-managed-certificate)

Everything worked fine and my content is delivered via HTTPS on my custom domain entry (and on the *.azureedge.net domain).
Naively, I tried to access to my content via HTTP (a non secured connection) and then i faced this error :
Our services aren't available right now
We're working to restore all services as soon as possible. Please check back soon.

I searched why and i found that i should set up a rule to redirect http traffic to https.
So i did it, like explained in this article https://learn.microsoft.com/en-us/azure/cdn/cdn-storage-custom-domain-https#http-to-https-redirection.![10752-2020-06-25-23h21-19.png][1]
But after that, no matter which domain name i use (my custom domain, or *.azureedge.net domain), when i try to access it via HTTP, it always show me the error:
Our services aren't available right now
We're working to restore all services as soon as possible. Please check back soon.

No redirection happens and the rule i added (which is the only rule i have) dont seems to work...

Did i miss something ?

Thanks for your help

Azure Content Delivery Network
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. TravisCragg-MSFT 5,681 Reputation points Microsoft Employee
    2020-07-20T22:20:57.513+00:00

    This error typically shows up whenever your backend only has HTTPS enabled. Try allowing both HTTP and HTTPS for your origin, and you should be able to access without an issue.

    2 people found this answer helpful.
    0 comments No comments

  2. Emilien Guilmineau 6 Reputation points
    2020-09-12T08:12:17.177+00:00

    Effectively!
    Thanks for your answer, it saved my day ^^
    For those who wiil read this post later, you must enabled HTTP on your backend (in your CDN Profile) even if you don't wan't to deliver HTTP.
    This allow the rule engine to receive HTTP request and to redirect them. If HTTP is not active, rule engine don't receive the HTTP requests, and your stuck with the problem i described.
    Once again, thank you @TravisCragg-MSFT

    1 person found this answer helpful.
    0 comments No comments