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.
Notice
  • For a specific domain name, the origin host is the accelerated domain name.
  • For a wildcard domain name, the origin host is the domain name that matches the wildcard domain and is actually visited by users. For example, if the wildcard domain name is *.aliyundoc.com and the domain name that is visited by users is example.aliyundoc.com, the origin host is example.aliyundoc.com.

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 The domain name that users visit.
    Origin Domain The domain name of the origin server.
    Note
    • If you set Domain Type to IP, Origin Domain is dimmed.
    • If you set Domain Type to OSS Domain, Origin Host is turned on and set to Origin Domain.
    Custom Domain You can specify a domain name.
    Note
    • Make sure that the domain name specified by you is associated with the origin server. Otherwise, back-to-origin routing fails.
    • If your 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:

imag.example.com

Address of the origin server:

example.com

  • If you set Domain Type to CDN Domain, requests are redirected to example.com that is hosted on the origin server image.example.com.
  • If you set Domain Type to Origin Domain, requests are redirected to the origin server example.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:

example.com

Address of the origin server:

10.10.10.10

  • If you set Domain Type to CDN Domain, requests are redirected to example.com that is hosted on the origin server 10.10.10.10.
  • If you set Domain Type to Custom Domain, requests are redirected to the specified custom domain name.
Example 3: The address of the origin server is an OSS endpoint.
Domain name Description
Accelerated domain name:

example.com

Address of the origin server:

example.oss-cn-hangzhou.aliyuncs.com

  • If you set Domain Type to CDN Domain, requests are redirected to example.com that is hosted on the origin server example.oss-cn-hangzhou.aliyuncs.com.
  • If you set Domain Type to Origin Domain, requests are redirected to the origin server example.oss-cn-hangzhou.aliyuncs.com.
  • If you set Domain Type to Custom Domain, requests are redirected to the specified custom domain name.