Manage access to content
By default, any user can access your content.
You can manage access to content:
- configure access by country — for example, allow access only from Russia or block access from certain countries;
- by domain — for example, allow displaying images only from your website
example.com; - by IP address — for example, allow access only from IP addresses in the office network;
- by client application — for example, allow access only from mobile devices.
Configure access by country
By default, access is allowed from all countries.
You can configure access rules for content from specific countries and regions. You can also add exceptions for regions of a country.
By default, an established rule is always active. You can also set a duration for the rule. If there are multiple rules, their active periods must not overlap.
-
In the Control panel, in the top menu, click Products and select CDN.
-
In the CDN resources section, open the CDN resource page → the Restrictions tab.
-
In the Geo restrictions block, click Add rule.
-
Select the rule type:
- Allow all except — access is allowed from all countries except the specified ones;
- Block all except — access is blocked 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 Except block, click Add country and region.
7.2. Select the country and region for which the rule should not apply. For example, if you blocked content access for users from all US regions, but want to keep access for users from Alabama, select the country
USA, region —Alabama. -
If the rule should be active for a specific period:
7.1. Click Add rule validity time.
7.2. Select the start and end date and time for the rule.
-
To add another rule, click Add rule and repeat steps 4–7.
-
Click Apply. While the rules are being applied, the CDN resource will have the
PROCESSINGstatus. During this time, applying other settings is unavailable. The rules will take effect when the CDN resource changes to theACTIVEstatus.
Configure access by domain
By default, access is allowed from all domains.
You can configure access rules for content from specific domains.
By default, an established rule is always active. You can also set a duration for the rule.
-
In the Control panel, in the top menu, click Products and select CDN.
-
In the CDN resources section, open the CDN resource page → the Restrictions tab.
-
In the Domain restrictions block, click Add rule.
-
Select the rule type:
- Allow all except — access is allowed for all domains except the specified ones;
- Block all except — access is blocked for all domains except the specified ones.
-
Specify the domains to which the rule applies. Enter domains without the protocol, for example,
example.com. Enter each domain on a new line. You can use:example.com— exact match;*.example.com— all subdomains for the root domainexample.com, not includingexample.com;.example.com— all third-level subdomains, including the root domainexample.com;~ad+.example.com— a regular expression to specify a complex rule.
-
If the rule should be active for a specific period:
6.1. Click Add rule validity time.
6.2. Select the start and end date and time for the rule.
-
To add another rule, click Add rule and repeat steps 4–6.
-
Click Apply. While the rules are being applied, the CDN resource will have the
PROCESSINGstatus. During this time, applying other settings is unavailable. The rules will take effect when the CDN resource changes to theACTIVEstatus.
Configure access by IP address
By default, access is allowed from all IP addresses.
You can configure access rules for content from specific IP addresses.
By default, an established rule is always active. You can also set a duration for the rule.
-
In the Control panel, in the top menu, click Products and select CDN.
-
In the CDN resources section, open the CDN resource page → the Restrictions tab.
-
In the IP restrictions block, click Add rule.
-
Select the rule type:
- Allow all except — access is allowed for all IP addresses except the specified ones;
- Block all except — access is blocked for 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 should be active for a specific period:
6.1. Click Add rule validity time.
6.2. Select the start and end date and time for the rule.
-
To add another rule, click Add rule and repeat steps 4–6.
-
Click Apply. While the rules are being applied, the CDN resource will have the
PROCESSINGstatus. During this time, applying other settings is unavailable. The rules will take effect when the CDN resource changes to theACTIVEstatus.
Configure access by client application
By default, access is allowed from all client applications — various devices and browsers.
You can configure access rules for content for specific client applications.
By default, an established rule is always active. You can also set a duration for the rule.
-
In the Control panel, in the top menu, click Products and select CDN.
-
In the CDN resources section, open the CDN resource page → the Restrictions tab.
-
In the User-Agent restrictions block, click Add rule.
-
Select the rule type:
- Allow all except — content access is allowed for all client applications except the specified ones;
- Block all except — content access is blocked for all client applications except the specified ones.
-
Specify the client applications to which the rule applies. Enter each value on a new line. You can use:
Example— exact match of the name;~[Ee]xample— partial match (works forExampleandexample);~^(curl).7— a regular expression to specify a complex rule.
-
If the rule should be active for a specific period:
6.1. Click Add rule validity time.
6.2. Select the start and end date and time for the rule.
-
To add another rule, click Add rule and repeat steps 4–6.
-
Click Apply. While the rules are being applied, the CDN resource will have the
PROCESSINGstatus. During this time, applying other settings is unavailable. The rules will take effect when the CDN resource changes to theACTIVEstatus.