Updated on 2024-07-08 GMT+08:00

Advanced Origins

You can configure advanced origins to allow CDN to pull content from different origin servers based on different URL paths.

Differences Between Advanced and Basic Origin Servers

Basic origin: origin server configured when you add a domain name to CDN. It is the default address of origin pulls for user requests.

Advanced origin: origin server from which CDN pulls content when a user request URL matches the resource type or path rule of this server.

Constraints

  • You can configure up to 20 rules.

Procedure

  1. Log in to Huawei Cloud console. Choose Service List > Content Delivery & Edge Computing > Content Delivery Network.

    The CDN console is displayed.

  2. In the navigation pane, choose Domains.
  3. In the domain list, click the target domain name or click Configure in the Operation column.
  4. Click the Origin Settings tab.
  5. Click Edit next to Advanced Origin.
    Figure 1 Advanced origins
    Table 1 Parameter description

    Parameter

    Description

    URI Match Mode

    URIs can be matched by All files, File name extension, and Directory.

    URI Match Rule

    • All files: All requested resources are pulled from the configured advanced origin server. Exercise caution when selecting this option.
    • File name extension
      • All file types are supported.
      • Start with a period (.) and separate multiple extensions by semicolons (;).
      • Enter up to 20 file name extensions.
      • Enter up to 512 characters.
      • File name extensions are case sensitive.

      Example: .JPG;.zip;.exe

    • Directory: Start with a slash (/) and separate multiple directories by semicolons (;). Enter up to 20 directories and up to 512 characters.

      Example: /test/folder01;/test/folder02

      NOTE:

      If you have signed URLs using method B or C1, URIs cannot be matched by Directory.

    Type

    Select IP address, Domain name, or OBS bucket.

    Address

    IP address
    • Enter an IPv4 address.
    Domain name
    • Start with a letter or digit. Enter up to 75 characters, including letters, digits, hyphens (-), and periods (.).
    • Third-party public object storage buckets can be accessed using their domain names.
    OBS bucket
    • Only OBS buckets of the current account can be accessed.
    • To access OBS private buckets, allow CDN to read OBS private buckets. For details, see OBS Authorization.
      NOTE:
      • You cannot add an OBS bucket if the domain name has special configuration.

    HTTP Port

    Port number for origin pull using HTTP.

    • The port number ranges from 1 to 65535. The default port is 80.
    • If Type is set to OBS bucket, this parameter cannot be modified.

    HTTPS Port

    Port number for origin pull using HTTPS.

    • The port number ranges from 1 to 65535. The default port is 443.
    • If Type is set to OBS bucket, this parameter cannot be modified.

    Origin Protocol

    Protocol used by CDN PoPs to pull content from the origin server.

    HTTP: CDN uses HTTP for origin pull.

    HTTPS: CDN uses HTTPS for origin pull. (Ensure that the origin server supports HTTPS access.)

    Same as user: The origin protocol is the same as the client access protocol. For example, if a client accesses CDN using HTTP, CDN also uses HTTP for origin pull.

    Host Header

    Host information of the advanced origin. For details, see Modifying the Host Header.

    • If Type is set to IP address or Domain name, the host is the acceleration domain name by default.
    • If Type is set to OBS bucket, the host is the OBS bucket domain name by default.

    Bucket

    This parameter is mandatory when Type is set to OBS bucket.

    • Public bucket: Select this option when the OBS bucket policy is public read or public read and write.
    • Private bucket: Select this option when the OBS bucket policy is private.

    Priority

    The priority value ranges from 1 to 100. The larger the value, the higher the priority.

    Operation

    Delete: Delete the rule.

  6. Configure parameters and click OK.

Example

Example: Assume that you have configured an advanced origin for domain name wwww.example01.com.

Configuration result: When a user requests an uncached JPG resource, CDN pulls the resource from the origin server wwww.example.com. CDN pulls other uncached resources from the basic origin server.