All Products
Search
Document Center

CDN:Configure advanced origin settings

Last Updated:Feb 27, 2026

Advanced origin settings route requests to different origin servers based on request attributes such as headers, query string parameters, paths, and cookies. Each rule maps a matching condition to a specific origin domain name, giving you flexible control over origin routing.

Limitations

ConstraintDetail
Maximum rules120
Supported origin typeDomain names only. IP addresses, OSS, and Function Compute origins are not supported.
Port configurationNot supported. To specify a port number, use conditional origin instead.
Feature conflictAdvanced origin and conditional origin cannot be enabled at the same time. Configure only one of the two.
Matching orderRules are evaluated in descending order. The first matching rule takes effect and subsequent rules are skipped.
To configure an IP, Object Storage Service (OSS), or Function Compute origin, or to specify a port number, use the conditional origin feature instead.

Origin type comparison

Alibaba Cloud CDN provides three origin types.

AspectBasic originConditional originAdvanced origin
PurposeDefault origin server address for origin fetchRule-based origin routingRule-based origin routing
Rules engine supportNoYesYes
When usedWhen no conditional or advanced origin rule matches the requestWhen a request matches a configured ruleWhen a request matches a configured rule
Supported origin typesDomain name, IP, OSS, Function ComputeDomain name, IP, OSS, Function ComputeDomain name only

How matching works: When a point of presence (POP) receives a request, it evaluates the advanced origin rules in descending order. If a rule matches, the POP forwards the request to the origin server specified in that rule. If no rule matches, the POP uses the basic origin address.

Matching criteria

Advanced origin rules support four criteria types. The POP checks the specified field in each incoming request and determines the target origin server.

CriteriaDescriptionExample use case
Request headerMatch based on an HTTP request header valueRoute requests with a specific X-App-Version header to a dedicated origin
Query string parameterMatch based on a query string parameter in the URLRoute requests containing test=1 to a staging origin
PathMatch based on the URL pathRoute /api/* requests to an API backend
Request cookieMatch based on a cookie value in the requestRoute requests with a specific session cookie to a regional origin

Create an advanced origin rule

Prerequisites

Before you begin, make sure that you have:

  • A domain name added to Alibaba Cloud CDN

  • The basic origin configured for the domain name

Procedure

  1. Log on to the Alibaba Cloud CDN console.

  2. In the left-side navigation pane, click Domain Names.

  3. On the Domain Names page, find the target domain name and click Manage in the Actions column.

  4. In the left-side navigation tree, click Origin Fetch.

  5. In the Advanced Origin section, click Customize.

  6. In the Advanced Origin dialog box, configure the following settings: Advanced origin dialog box

    • Criteria: Select a matching condition type (request header, query string parameter, path, or request cookie) and specify the match value.

    • Origin Domain Name: Enter the domain name of the origin server to which matching requests are redirected.

  7. Click OK.

Examples

Route requests by query string parameter

Scenario: Route all requests that contain the query string parameter test=1 to a dedicated test origin server.

Configuration:

  • Criteria: Query string parameter equals test=1

  • Origin Domain Name: img2.yourdomain.com

Result: When a POP receives a request such as https://yourdomain.com/image.png?test=1, it forwards the request to img2.yourdomain.com instead of the basic origin.

Example: query string parameter routing