Tencent Cloud CDN supports configuring User-Agent (UA) blocklist/allowlist rules for access control.
CDN checks the
User-Agent field in HTTP request headers based on the rules to allow or reject user access requests.
*. Please separate multiple values with
Log in to the CDN Console, select Domain Management on the left sidebar, and then click Manage on the right of a domain name to enter its configuration page. Select Access Control tab to find the UA blocklist/allowlist configuration, which is disabled by default:
When the switch is toggled off, click Add Rule to add blocklist/allowlist rules one by one:
- Only the wildcard
*is supported; other regular expressions are not supported.
- If there is no
*, all characters will be used for exact match.
The overall configuration will be disabled after a rule is added, so the ongoing services will not be affected:
You can toggle the switch on to officially deploy the configured UA blocklist/allowlist.
The UA blocklist/allowlist configuration of
cloud.tencent.com is as follows:
User-Agent in the HTTP request header is as follows:
user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36
The blocklist will be hit and a 403 error will be directly returned.