CDN 用戶操作
CDN User Guide
CDN User Guide
  • Domain Management
    • Add Domain
    • Batch Modify Upstream
    • Batch Remove Specific Domains
    • Export Site Records
  • Modules
    • Site Certificate
    • Token Auth
    • Custom Header
    • Redirects
    • CORS Setting
    • Proxy Rewrite
  • Site Settings
    • Cache Setting
    • Compress
    • Rates Limit
    • DNS API
    • Ports
  • Firewall
    • Whitelist Setting
    • Blacklist Setting
    • Positions Setting
    • Anti CC Setting
    • Interval Freq. Limit
    • Second Freq. Limit
    • User Agent Setting
  • ACL
  • Block List
  • Error Pages
  • Site Info.
Powered by GitBook
On this page
  • How to Set Up User-Agent Blocking?
  • Add User Agent Field Descriptions
  • Blocking Example
  1. Firewall

User Agent Setting

PreviousSecond Freq. LimitNextACL

Last updated 6 months ago

How to Set Up User-Agent Blocking?

  • Sites → Sites Settings → Firewall → User Agent Setting → Create

Add User Agent Field Descriptions

  • URL: Specify the domain being accessed. You can enter a direct domain or use regex for matching:

    • Example:

      • gerrard.cdn-cname.com

      • https?:\/\/gerrard.cdn-cname.com(.*)

  • User-Agent: Specify the User-Agent you want to block; must be in regex format.

  • Protect Mode: There are three options:

    • DENY: Rejects connections with the specified User-Agent. The client will see a 403 Forbidden error.

    • DROP: Drops connections with the specified User-Agent. The client will see a Connection reset by peer error.

    • DROP + Blacklist: Drops connections with the specified User-Agent and adds the source IP to the blacklist.

Blocking Example

  • Example Domain: gerrard.cdn-cname.com

  • User-Agent to Block: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36

  • Command Test: curl -v -k https://gerrard.cdn-cname.com -A 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.75 Safari/537.36'

  • Test for Blocking Success