Files
doc-exports/docs/obs/api-ref/obs_04_0059.html
weihongmin1 285f8e4a64 OBS API 0826 Version
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com>
Co-authored-by: weihongmin1 <weihongmin1@huawei.com>
Co-committed-by: weihongmin1 <weihongmin1@huawei.com>
2025-10-28 10:02:29 +00:00

11 KiB

Configuring a Custom Domain Name for a Bucket

Functions

OBS uses the PUT method to configure a custom domain name for a bucket. After the configuration is successful, you can access the bucket through the domain name.

To perform this operation, the user must be the bucket owner or the bucket owner's IAM user that has permissions required for configuring custom domain names.

Ensure that the custom domain name can correctly resolve to the OBS service through DNS.

Request Syntax

1
2
3
4
5
6
7
PUT /?customdomain=domainname HTTP/1.1
User-Agent: curl/7.29.0
Host: bucketname.obs.region.example.com
Accept: */*
Date: date
Authorization: authorization string
Content-Length: 0

Request Parameters

Table 1 Request parameters

Parameter

Description

Mandatory (Yes/No)

customdomain

Definition:

Custom domain name of a bucket.

Type: String, which must meet the naming conventions of domain names.

Constraints:

A bucket can have a maximum of 30 domain names. One custom domain name can be used for only one bucket.

Range:

The maximum length is 256 bytes.

Default value:

None

Yes

Request Header

Table 2 Request headers

Header

Type

Mandatory (Yes/No)

Description

Content-MD5

String

No

Definition:

This header is mandatory when you configure a custom domain name certificate to verify that the content of the request body is consistent with what was sent.

Base64-encoded 128-bit MD5 value of the request body calculated according to RFC 1864.

Example: n58IG6hfM7vqI4K0vnWpog==

Constraints:

None

Range:

None

Default value:

None

For details about other common headers, see Table 3.

Request Elements

This request involves no elements.

Response Syntax

1
2
3
4
5
6
HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: request id
x-obs-id-2:  id
Date: date
Content-Length: 0

Response Headers

The response to the request uses common headers. For details, see Table 1.

Response Elements

This response contains no elements.

Error Responses

No special error responses are returned. For details about error responses, see Table 2.

Sample Request

1
2
3
4
5
6
7
PUT /?customdomain=obs.ccc.com HTTP/1.1
User-Agent: curl/7.29.0
Host: examplebucket.obs.region.example.com
Accept: */*
Date: Mon, 14 Jan 2019 08:31:36 +0000
Authorization: OBS UDSIAMSTUBTEST000094:u2kJF4kENs6KlIDcAZpAKSKPtnc=
Content-Length: 0

Sample Response

1
2
3
4
5
6
HTTP/1.1 200 OK
Server: OBS
x-obs-request-id: 000001697692CC5380E9D272E6D8F830
x-obs-id-2: 32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSsfu2GXj9gScHhFnrrTPY2cFOEZuvta
Date: Wed, 13 Mar 2019 10:22:05 GMT
Content-Length: 0