title | description | services | author | ms.service | ms.topic | ms.date | ms.author |
---|---|---|---|---|---|---|---|
Use a rules engine to enforce HTTPS in Standard Azure CDN | Microsoft Docs |
Use the rules engine for Microsoft Standard Azure Content Delivery Network (Azure CDN) to customize how Azure CDN handles HTTP requests, including blocking the delivery of certain types of content, defining a caching policy, and modifying HTTP headers. In this article, learn how to create a rule to redirect users to HTTPS. |
cdn |
asudbring |
azure-cdn |
how-to |
11/01/2019 |
allensu |
This article describes how to set up and use the Standard rules engine for Azure Content Delivery Network (Azure CDN).
You can use the Standard rules engine for Azure CDN to customize how HTTP requests are handled. For example, you can use the rules engine to enforce content delivery to use specific protocols, to define a caching policy, or to modify an HTTP header. This article demonstrates how to create a rule that automatically redirects users to HTTPS.
Note
The rules engine that's described in this article is available only for Standard Azure CDN from Microsoft.
-
In your Microsoft profiles, go to Azure Content Delivery Network.
-
On the CDN profile page, select the endpoint you want to create rules for.
-
Select the Rules Engine tab.
The Rules Engine pane opens and displays the list of available global rules.
[!IMPORTANT] The order in which multiple rules are listed affects how rules are handled. The actions that are specified in a rule might be overwritten by a subsequent rule.
-
Select Add rule and enter a rule name. Rule names must begin with a letter and can contain only numbers and letters.
-
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.
[!NOTE] You can select from multiple match conditions in the Add condition drop-down list. For a detailed list of match conditions, see Match conditions in the Standard rules engine.
-
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.
[!NOTE] You can select from multiple actions in the Add action drop-down list. For a detailed list of actions, see Actions in the Standard rules engine.
-
Select Save to save the new rule. The rule is now available to use.
[!IMPORTANT] Rule changes might take up to 15 minutes to propagate through Azure CDN.