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
| Constraint | Detail |
|---|---|
| Maximum rules | 120 |
| Supported origin type | Domain names only. IP addresses, OSS, and Function Compute origins are not supported. |
| Port configuration | Not supported. To specify a port number, use conditional origin instead. |
| Feature conflict | Advanced origin and conditional origin cannot be enabled at the same time. Configure only one of the two. |
| Matching order | Rules 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.
| Aspect | Basic origin | Conditional origin | Advanced origin |
|---|---|---|---|
| Purpose | Default origin server address for origin fetch | Rule-based origin routing | Rule-based origin routing |
| Rules engine support | No | Yes | Yes |
| When used | When no conditional or advanced origin rule matches the request | When a request matches a configured rule | When a request matches a configured rule |
| Supported origin types | Domain name, IP, OSS, Function Compute | Domain name, IP, OSS, Function Compute | Domain 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.
| Criteria | Description | Example use case |
|---|---|---|
| Request header | Match based on an HTTP request header value | Route requests with a specific X-App-Version header to a dedicated origin |
| Query string parameter | Match based on a query string parameter in the URL | Route requests containing test=1 to a staging origin |
| Path | Match based on the URL path | Route /api/* requests to an API backend |
| Request cookie | Match based on a cookie value in the request | Route 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
Log on to the Alibaba Cloud CDN console.
In the left-side navigation pane, click Domain Names.
On the Domain Names page, find the target domain name and click Manage in the Actions column.
In the left-side navigation tree, click Origin Fetch.
In the Advanced Origin section, click Customize.
In the Advanced Origin dialog box, configure the following settings:

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.
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=1Origin 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.
