Advanced origin

更新时间:
复制 MD 格式

The advanced origin feature allows you to route client requests to different origins based on parameters such as the request header, query string parameter, path, or request cookie.

Usage notes

  • Rule limit: You can create a maximum of 120 rules.

  • Feature conflict: The conditional origin and advanced origin features are mutually exclusive. You can enable only one of them at a time.

  • Matching order: Rules are evaluated in the order they are listed. Processing stops after the first matching rule is found.

  • Port number: The advanced origin feature supports only domain name origins. You cannot specify a port number. To specify a port number for an origin domain name, or to configure an IP origin, OSS origin, or Function Compute origin, use conditional origin instead.

  • Path matching: Path matching in advanced origin supports only exact match. Wildcards and regular expressions are not supported. To route requests based on a path wildcard, such as /api/*, use conditional origin in combination with the rules engine.

Origin type comparison

Both conditional origins and advanced origins can reference rule conditions from the rules engine to create flexible origin pull policies. CDN automatically selects an origin if a request matches a rule condition.

Origin type

Trigger condition

Conditional origin

The request matches the rule condition referenced by the conditional origin.

Advanced origin

The request matches the rule condition referenced by the advanced origin.

Basic origin

The request does not match any conditional or advanced origin rule (fallback rule).

Procedure

  1. Log on to the CDN console.

  2. In the left 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 domain's navigation pane, click Origin Fetch.

  5. In the Advanced Origin section, click Customize.

  6. In the Advanced Origin dialog box, select the Criteria and enter the Origin Domain Name.

    Note

    You can configure different origins based on the request header, query string parameter, path, or request cookie. When a point of presence (POP) receives a client request, it reads the corresponding field in the request, evaluates the match, and routes the request to the appropriate origin.

    For the criteria, you must configure the Field Name, a match type (such as Equals), and the corresponding Value. Example format for an origin domain name: img.yourdomain.com. The origin domain name cannot be the same as the accelerated domain name.

  7. Click OK.

Example

This example shows how to route requests containing the parameter test=1 to the origin. In the Advanced Origin dialog box, set Criteria to Query String Parameter. Set the parameter name to test, the condition to Equals, and the value to 1. Then, set the Origin Domain Name to img.yourdomain1.com and click OK.