If multiple sites are hosted on your origin server, and the site for which back-to-origin routing is enabled is different from the one to which the accelerated domain name points, you must configure an origin host. An origin host specifies the site to which Alibaba Cloud CDN redirects requests.

Background information

Differences between an origin server and an origin host:
  • An origin server is where your workloads run, and defines a specific IP address to which requests are redirected.
  • An origin host is the value of the HOST header in back-to-origin requests, and defines a specific site that is hosted on a specific IP address. Back-to-origin requests are redirected to the site.

Scenarios where an origin host is not required:

By default, the origin host is the accelerated domain name. You do not need to configure an origin host in the following scenarios:

  • The origin server uses an IP address. In this case, the origin host is the accelerated domain name.
  • The origin server uses an Object Storage Service (OSS) endpoint. In this case, the origin host is the domain name of the origin server.

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 domain name that you want to manage and click Manage in the Actions column of the domain name.
  4. In the management pane of the domain name, click Back-to-origin.
  5. In the Origin Host section, click Modify.
  6. Turn on Origin Host and set Domain Type.
    Origin host settings
    Parameter Description
    CDN Domain Specify the domain name that you want Alibaba Cloud CDN to accelerate. The domain name is the one that users access.
    Origin Domain Specify the domain name of the origin server. The domain name is the one to which Alibaba Cloud CDN redirects requests.
    Custom Domain If you set Domain Type to Custom Domain, specify a custom domain name as the origin host.

    If the origin server is associated with multiple domain names, you must specify a domain name to which requests are redirected. Otherwise, back-to-origin routing fails.

  7. Click the OK tab.

Example

Example 1: The address of the origin server is a domain name.
Domain name Description
Accelerated domain name:

cdntest.com

Address of the origin server:

origin.com

  • If you set Domain Type to CDN Domain, requests are redirected to cdntest.com that is hosted on the origin server origin.com.
  • If you set Domain Type to Origin Domain, requests are redirected to the origin server origin.com.
  • If you set Domain Type to Custom Domain, the origin host is set to the specified custom domain name.
Example 2: The address of the origin server is an IP address.
Domain name Description
Accelerated domain name:

cdntest.com

Address of the origin server:

1.1.1.1

  • If you set Domain Type to CDN Domain, requests are redirected to cdntest.com that is hosted on the origin server 1.1.1.1.
  • If you set Domain Type to Custom Domain, requests are redirected to the specified custom domain name.
Note The address of the origin server is an IP address. Therefore, the Origin Domain option is dimmed.
Example 3: The address of the origin server is an OSS endpoint.
Domain name Description
Accelerated domain name:

cdntest.com

Address of the origin server:

test.oss-cn-hangzhou.aliyuncs.com

  • If you set Domain Type to CDN Domain, requests are redirected to cdntest.com that is hosted on the origin server test.oss-cn-hangzhou.aliyuncs.com.
  • If you set Domain Type to Origin Domain, requests are redirected to the origin server test.oss-cn-hangzhou.aliyuncs.com.
  • If you set Domain Type to Custom Domain, requests are redirected to the specified custom domain name.
Note If the address of the origin server is an OSS endpoint, the origin host is enabled. You must set the following parameters:

Domain Type: select Origin Domain

Address of the origin server: test.oss-cn-hangzhou.aliyuncs.com