Specifies an origin host for an accelerated domain name.

Before you call this operation, take note of the following rules:

If the origin server is an Object Storage Service (OSS) bucket, you must specify the OSS bucket as the origin host to ensure that back-to-origin routing works as expected.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes SetSourceHostConfig

The operation that you want to perform. Set the value to SetSourceHostConfig.

DomainName String Yes www.yourdomain.com

The accelerated domain name. You can specify only one domain name.

Enable String No On

Specifies whether to enable the origin host feature. Valid values:

  • on (default): enable
  • off: disable
BackSrcDomain String No www.aliyun.com

The origin host. If Enable is set to on, you must set this parameter.

Response parameters

Parameter Type Example Description
RequestId String 16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

The ID of the request.

Examples

Sample requests

http://cdn.aliyuncs.com?Action=SetSourceHostConfig
&BackSrcDomain=example.com
&DomainName=example.com
&<Common request parameters>

Sample success responses

XML format

<SetSourceHostConfigResponse>
      <RequestId>AED00EC1-32A8-4D48-BEB9-BD782AF3C6BD</RequestId>
</SetSourceHostConfigResponse>

JSON format

{
    "RequestId": "04F0F334-1335-436C-A1D7-6C044FE73368"
}

Error codes

HttpCode Error code Error message Description
400 InvalidParameter The specified value of parameter "Enable" is not valid. The error message returned because the Enable parameter is set to an invalid value.
400 MissingBackSrcDomain The input parameter BackSrcDomain that is mandatory for processing this request is not supplied. The error message returned because the BackSrcDomain parameter must be set.
400 InvalidBackSrcDomain.Malformed Specified BackSrcDomain is malformed. The error message returned because the format of the origin host (BackSrcDomain) is invalid.

For a list of error codes, visit the API Error Center.