Help Center> Object Storage Service> User Guide> User-Defined Domain Name Binding

User-Defined Domain Name Binding

Application Scenario

If you need to migrate files from a website to OBS, and do not want to modify the web page code, that is, to remain the link of the website unchanged, you can use user-defined domain name binding.

For example, if the domain name of your website is www.example.com and the website file is abc.html, then the website address is http://www.example.com/abc.html. The configuration procedure is as follows:

  1. Create a bucket in OBS, and upload the abc.html website file to the bucket.
  2. On OBS Console, bind your website domain name www.example.com to the created bucket.
  3. (Optional) When the number of visits to a website is greater than 100,000, CDN is recommended. You can configure CDN acceleration to implement website acceleration, file download acceleration, and VOD acceleration.
  4. On the DNS server, add a CNAME rule and map www.example.com to the domain name of the bucket.
  5. After the http://www.example.com/abc.html request reaches OBS, OBS finds the mapping between the www.example.com and the bucket domain name, and redirects it to the abc.html file stored in the bucket. That is, after OBS processes the request of access to the http://www.example.com/abc.html, the http://bucket domain name/abc.html is actually accessed.

Constraints

  • Only buckets of version 3.0 or later support user-defined domain name binding. To check the bucket version, go to the Overview page of the bucket on OBS Console. Then you can view the bucket version in the Basic Information area.
  • A maximum of 30 user-defined domain names can be bound to each bucket.
  • Currently, user domain names bound to OBS only allow access requests over HTTP.

    If you want to use a user domain name to access OBS over HTTPS, you need to enable CDN to manage HTTPS certificates.

    For details about how to manage HTTPS certificates on the CDN management console, see HTTPS Settings.

  • A user-defined domain name can be bound to only one bucket.
  • Currently, the suffix of a user-defined domain name can contain 2 to 6 uppercase and lowercase letters.

How to Use This Function

You can configure user-defined domain name binding using OBS Console, APIs, or SDKs.

Tool

Reference

OBS Console

Configuring User-Defined Domain Name Binding

SDKs

OBS supports software development kits (SDKs) in multiple languages. For details, see the corresponding developer guide on the SDK Overview page.

APIs

Configuring a Custom Domain Name for a Bucket