Updated on 2022-10-24 GMT+08:00

Referer Validation

Referer validation allows you to control access sources based on the referer field carried in a request. CDN filters requests based on the configured blacklist or whitelist.

Notes

  • This function is optional and is disabled by default.
  • Whitelisting and blacklisting cannot be used simultaneously.
  • A maximum of 100 domain names of up to four levels can be added to the blacklist or whitelist.
  • The domain name configured in a blacklist or whitelist cannot contain a protocol name. The domain name is matched by prefix. For example, if you enter example.example01.com, example.example01.com/123 and example.example01.com.cn are also matched.

Procedure

  1. Log in to the VOD console.
  2. In the navigation pane, choose Domain Name Management.
  3. Click Settings in the row containing your domain name and then click the Hotlink Protection Settings tab.
  4. Click Referer Validation. The page for configuring referer validation is displayed.
  5. Turn on the switch. Configure referer validation parameters. See Figure 1.

    Domain names with ports cannot be added to referer whitelists/blacklists.

    Figure 1 Referer validation settings
    Table 1 describes the parameters.
    Table 1 Parameter description

    Parameter

    Description

    Type

    The blacklist and whitelist are supported.
    • Referer blacklist allows all domains access to CDN except for the domains added to the blacklist.
    • Referer whitelist denies all domains access to CDN except for the domains added to the whitelist.
    An empty referer indicates that the referer field in an HTTP request header is empty or no referer exists.
    • If you select Blacklist and Include empty referer, a request with empty referer will be denied.
    • If you select Whitelist and Include empty referer, a request with empty referer will be allowed.

    Rule

    Domain name in the blacklist or whitelist.

    Domain names and IP addresses can be input at the same time and separated with semicolons (;). Wildcard domain names are supported. A maximum of 100 domain names and IP addresses can be entered.

    Example:

    www.example.com;*.test.com;192.168.0.0

  6. Click OK.

    It takes about 3 to 5 minutes for the referer validation to take effect.