UA Blocklist/Allowlist Configuration

Last updated: 2025-02-18 15:03:23

Configuration Scenario

Tencent Cloud CDN supports access control by configuring User-Agent blocklist and allowlist rules. By performing rule judgment on the User-Agent in the user HTTP request header, user access can be allowed or denied as needed.

Configuration Guide

Viewing Configuration

Log in to the CDN console, select Domain Management from the menu bar, and click Management on the right side of the domain to enter the domain configuration page. In the second column Access Control, you can see the UA blocklist and allowlist configuration, which is disabled by default:



Adding rules

Click Adding rules to add blocklist (allowlist) entries one by one as needed:



Configuration limitations

Only support setting all to blocklist or all to allowlist, and do not support setting both blocklist and allowlist rules simultaneously.
Up to 10 blocklist or allowlist rules can be configured.
Rules support the wildcard *. Please separate multiple values with |.
Supported effect types: all content, file extension, file directory, and specified file. Regular matching is currently not supported.
Note
1. Supports wildcard * and multiple values, such as curl*|*IE*|*Chrome*|*firefox*. ^$ represents an empty User-Agent. If the rule content includes an empty User-Agent, handle it as follows: In the allowlist scenario, if the User-Agent in the request is empty, the request is allowed. In the blocklist scenario, if the User-Agent in the request is empty, the request is denied.
2. If there is no *, all characters will be used for exact match.

Configuration Example

If the UA allowlist/blocklist configuration of the acceleration domain name cloud.tencent.com is as follows:

When the 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.