Skip to main content

Manage access to content

Last update:

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 images to be shown 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.

  1. In the control panel, from the top menu, click Products and select CDN.

  2. In the CDN Resources section, open the CDN resource page → Restrictions tab.

  3. In the Geo restrictions block, click Add rule.

  4. Select the rule type:

    • Allow all except — access is allowed from all countries except those specified;
    • Block all except — access is blocked from all countries except those specified.
  5. Click Add country and region and select a country and region.

  6. 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 And excluding 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 regions of the USA but want to keep access for users from Alabama — select country USA, region — Alabama.

  7. If the rule should be active for a specific period:

    7.1. Click Add rule duration.

    7.2. Select the start and end date and time for the rule.

  8. To add another rule, click Add rule and repeat steps 4–7.

  9. Click Apply. While the rules are being applied, the CDN resource will be in the PROCESSING status. During this time, applying other settings is unavailable. The rules will be applied when the CDN resource transitions to the ACTIVE status.

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.

  1. In the control panel, from the top menu, click Products and select CDN.

  2. In the CDN Resources section, open the CDN resource page → Restrictions tab.

  3. In the Domain restrictions block, click Add rule.

  4. Select the rule type:

    • Allow all except — access is allowed for all domains except those specified;
    • Block all except — access is blocked for all domains except those specified.
  5. Specify the domains the rule applies to. 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 subdomains for the main domain example.com, excluding example.com;
    • .example.com — all third-level subdomains, including the main domain example.com;
    • ~ad+.example.com — regular expression to specify a complex rule.
  6. If the rule should be active for a specific period:

    6.1. Click Add rule duration.

    6.2. Select the start and end date and time for the rule.

  7. To add another rule, click Add rule and repeat steps 4–6.

  8. Click Apply. While the rules are being applied, the CDN resource will be in the PROCESSING status. During this time, applying other settings is unavailable. The rules will be applied when the CDN resource transitions to the ACTIVE status.

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.

  1. In the control panel, from the top menu, click Products and select CDN.

  2. In the CDN Resources section, open the CDN resource page → Restrictions tab.

  3. In the IP restrictions block, click Add rule.

  4. Select the rule type:

    • Allow all except — access is allowed for all IP addresses except those specified;
    • Block all except — access is blocked for all IP addresses except those specified.
  5. Specify the IP addresses to which the rule applies. Enter each IP address on a new line.

  6. If the rule should be active for a specific period:

    6.1. Click Add rule duration.

    6.2. Select the start and end date and time for the rule.

  7. To add another rule, click Add rule and repeat steps 4–6.

  8. Click Apply. While the rules are being applied, the CDN resource will be in the PROCESSING status. During this time, applying other settings is unavailable. The rules will be applied when the CDN resource transitions to the ACTIVE status.

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.

  1. In the control panel, from the top menu, click Products and select CDN.

  2. In the CDN Resources section, open the CDN resource page → Restrictions tab.

  3. In the User-Agent restrictions block, click Add rule.

  4. Select the rule type:

    • Allow all except — access to content is allowed for all client applications except those specified;
    • Block all except — access to content is blocked for all client applications except those specified.
  5. Specify the client applications to which the rule applies. Enter each value on a new line. You can use:

    • Example — exact name match;
    • ~[Ee]xample — partial match (applies to Example and example);
    • ~^(curl).7 — regular expression to specify a complex rule.
  6. If the rule should be active for a specific period:

    6.1. Click Add rule duration.

    6.2. Select the start and end date and time for the rule.

  7. To add another rule, click Add rule and repeat steps 4–6.

  8. Click Apply. While the rules are being applied, the CDN resource will be in the PROCESSING status. During this time, applying other settings is unavailable. The rules will be applied when the CDN resource transitions to the ACTIVE status.