Updated on 2024-04-25 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

The basic origin server is the default address of origin pulls. CDN pulls content from the advanced origin server only when a user request URL matches the rule of the advanced origin server.

Precautions

  • You can configure up to 20 rules.
  • You cannot configure advanced origins on the console for domain names with special configurations.
  • Domain names whose service type is whole site acceleration do not support this function.

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 each file name extension with a period (.), and separate file name extensions with 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
    • Enter up to 250 characters.
    • Third-party object storage buckets (public buckets) can be accessed using origin server domain names.
    OBS bucket
    • Enter up to 250 characters.
    • 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

    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 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 65,535. 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 advanced origins 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.