To control the source of access to your business resources, you can use the IP blocklist/allowlist feature in Tencent Cloud CDN.
By configuring an access control policy on IPs of user requests, you can effectively control the source of access, preventing hotlinking by malicious IPs, attacks, etc.
Log in to the CDN console, select Domain Management on the left sidebar, and click Manage on the right of a domain name to enter its configuration page. Open the Access Control tab to see the IP Blocklist/Allowlist Configuration section. It is disabled by default.
Toggle on the switch, tick Blocklist or Allowlist, enter the list of IPs or IP ranges, and click Save:
If a client IP hits the blocklist, a 403 error is returned when it tries to access the CDN node.
If a client IP is not included in the allowlist, a 403 error is returned when it tries to access the CDN node.
IP:Portis not supported here.
You can toggle off this feature directly. When the switch is off, this feature does not take effect in the production environment even if there is an existing configuration. If you toggle the switch on, the configuration will take effect across the entire network after the action is confirmed.
If your acceleration domain name is configured for global acceleration, the IP blocklist/allowlist will take effect globally.
Suppose that the IP blocklist/allowlist configuration of the domain name
www.test.com is as follows:
Then the actual access will be as follows:
http://www.test.com/test.txt, as the IP is in the allowlist, the requested content will be returned normally.
http://www.test.com/test.txt, as the IP is not in the allowlist, a 403 status code will be returned.