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 Dynamic Route for CDN (DCDN) redirects requests.

Background information

Differences between an origin server and an origin host:
  • An origin server is where your workloads run. If you set the origin server as the destination for back-to-origin requests, the requests are redirected to the IP address of the origin server.
  • An origin host is the value of the HOST header in back-to-origin requests. If you set the origin host as the destination for back-to-origin requests, the requests are redirected to the site defined by the origin host.

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:

  • If the origin type is an IP address, the origin host is the accelerated domain name.
  • If the origin type is an Object Storage Service (OSS) domain name, the origin host is the domain name of the origin server.

Procedure

  1. Log on to the DCDN 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 Configure in the Actions column.
  4. In the left-side navigation pane on the details page of the specified domain name, click Origin Fetch.
  5. On the Origin Fetch tab, find Origin Host.
  6. Turn on Origin Host and specify Domain Type.
    Origin host
    Parameter Description
    Domain Name to Accelerate The domain name that you want Alibaba Cloud DCDN to accelerate. The domain name is the one that users access.
    Origin Domain Name The domain name of the origin server. The domain name is the one to which Alibaba Cloud DCDN 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 OK.

Configuration examples

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

image.example.com

Address of the origin server:

example.com

  • If you set Domain Type to Domain Name to Accelerate, back-to-origin requests are redirected to image.example.com that is hosted on the origin server example.com.
  • If you set Domain Type to Origin Domain Name, back-to-origin requests are redirected to the origin server example.com.
  • If you set Domain Type to Custom Domain, the origin host is the custom domain name that you specify.
Example 2: The address of the origin server is an IP address.
Domain name Description
Accelerated domain name:

image.example.com

Address of the origin server:

1.1.1.1

  • If you set Domain Type to Domain Name to Accelerate, requests are redirected to image.example.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 domain name that you specify.
Note The address of the origin server is an IP address. Therefore, the Origin Domain Name option for Domain Type is unavailable.
Example 3: The address of the origin server is an OSS domain name.
Domain name Description
Accelerated domain name:

image.example.com

Address of the origin server:

test.oss-cn-hangzhou.aliyuncs.com

  • If you set Domain Type to Domain Name to Accelerate, back-to-origin requests are redirected to image.example.com that is hosted on the origin server test.oss-cn-hangzhou.aliyuncs.com.
  • If you set Domain Type to Origin Domain Name, back-to-origin requests are redirected to the origin server test.oss-cn-hangzhou.aliyuncs.com.
  • If you set Domain Type to Custom Domain, back-to-origin requests are redirected to the domain name that you specify.
Note If the address of the origin server is an OSS domain name, the origin host feature is enabled. You must set the following parameters:

Domain Type: Select Origin Domain Name.

Domain Name: test.oss-cn-hangzhou.aliyuncs.com.