Manage access to content
By default, any user can get your content.
You can control access to content:
- customize access by country - for example, allow access only from Russia or block access from some countries;
- by domain - for example, only allow images from your site to be shown
example.com; - by IP address - For example, to allow access only to IP addresses on the office network;
- on client applications - For example, to allow access only from mobile devices.
Customize access by country
By default, access is allowed from all countries.
You can customize rules for accessing content from specific countries and regions. You can also add exceptions for country regions.
By default, the set rule is always valid. You can also set the period of validity of a rule. If there are multiple rules, their validity periods must not overlap.
-
In the Control Panel, on the top menu, click Products and select CDN.
-
In the CDN Resources section, open the resource page → Restrictions tab.
-
In the Geo Restrictions block, click Add Rule.
-
Select the type of rule:
- Allow all except - access is allowed from all countries except the specified ones;
- Deny all but - access is denied from all countries except the specified ones.
-
Click Add Country and Region and select a country and region.
-
If you need to make an exception for a region of the selected country so that the rule does not apply to it:
7.1. In the But excluded: box, click Add country and region.
7.2 Select the country and region for which the rule should not apply. For example, you have denied access to content to users from all regions of the United States, but you want to allow access to users from Alabama. Make an exception: select the
UScountry and theAlabamaregion. -
If the rule is to be in effect for a specific period:
7.1 Click Add Rule Effective Time.
7.2 Select the start and end date and time of the rule.
-
If you need to add multiple rules, click Add Rule and repeat steps 4-7.
-
Click Apply. While the rules are being applied, the resource will be in
PROCESSINGstatus . No other settings can be applied at this time. The rules will be applied when the share changes toACTIVEstatus.
Configure access by domain
By default, access is allowed from all domains.
You can configure rules for accessing content from specific domains.
By default, the set rule is always valid. You can also set the period of validity of the rule.
-
In the Control Panel, on the top menu, click Products and select CDN.
-
In the CDN Resources section, open the resource page → Restrictions tab.
-
In the Domain Restrictions block, click Add Rule.
-
Select the type of rule:
- Allow all except - access is allowed to all domains except the specified ones;
- Deny access to all but - access is denied to all domains except the specified ones.
-
Specify the domains to which the rule applies. Enter domains without a protocol, for
example example.com. Enter each domain on a new line. You can use:example.com- exact match;~.*.example.com- all example.com subdomains, not includingexample.com;~.*example.com- all third-level subdomains, includingexample.com;~ad+.example.com- regular expression to specify a complex rule.
-
If the rule is to be in effect for a specific period:
6.1 Click Add Rule Validity Time.
6.2 Select the start and end date and time of the rule.
-
If you need to add multiple rules, click Add Rule and repeat steps 4-6.
-
Click Apply. The resource will be in
PROCESSINGstatus while the rules are being applied . No other settings can be applied at this time. The rules will be applied when the share changes toACTIVEstatus.
Configure access by IP addresses
By default, access is allowed from all IP addresses.
You can configure rules for accessing content from specific IP addresses.
By default, the set rule is always valid. You can also set the period of validity of the rule.
-
In the Control Panel, on the top menu, click Products and select CDN.
-
In the CDN Resources section, open the resource page → Restrictions tab.
-
In the IP Restrictions block, click Add Rule.
-
Select the type of rule:
- Allow all except - access is allowed to all IP addresses except the specified ones;
- Deny all except - access is denied to all IP addresses except the specified ones.
-
Specify the IP addresses to which the rule applies. Enter each IP address on a new line.
-
If the rule is to be in effect for a specific period:
6.1 Click Add Rule Validity Time.
6.2 Select the start and end date and time of the rule.
-
If you need to add multiple rules, click Add Rule and repeat steps 4-6.
-
Click Apply. While the rules are being applied, the resource will be in
PROCESSINGstatus . No other settings can be applied at this time. The rules will be applied when the share changes toACTIVEstatus.
Configure access by client applications
By default, access is allowed from all client applications - different devices and browsers.
You can configure content access rules for specific client applications.
By default, the set rule is always valid. You can also set the period of validity of the rule.
-
In the Control Panel, on the top menu, click Products and select CDN.
-
In the CDN Resources section, open the resource page → Restrictions tab.
-
In the User-Agent Restrictions block, click Add Rule.
-
Select the type of rule:
- Allow all but - content access is allowed to all client applications except the specified ones;
- Deny all but - access to the content is denied to all client applications except the specified ones.
-
Specify the client applications to which the rule applies. Specify each value on a new line. You can use:
Example- exact match of the name;~[Ee]xample- partial matching (works forExampleandexample);~^(curl).7- regular expression to specify a complex rule.
-
If the rule is to be in effect for a specific period:
6.1 Click Add Rule Validity Time.
6.2 Select the start and end date and time of the rule.
-
If you need to add multiple rules, click Add Rule and repeat steps 4-6.
-
Click Apply. The resource will be in
PROCESSINGstatus while the rules are being applied . No other settings can be applied at this time. The rules will be applied when the share changes toACTIVEstatus.