Configuration Process on the OBS Console
Background
A game website has stored a large number of files such as software packages, pictures, and videos on OBS. As the number of users increases, game downloading and image loading become slower, especially for users who are far away from the file storage area. To address this issue, the website decided to use the CDN service to accelerate game downloads at the lowest cost and improve user experience.
Required Data
| Item | Description | Example |
|---|---|---|
| Domain Name | Domain name of the game website. If the service area of your website is Chinese mainland or global, the domain name must be licensed by the Ministry of Industry and Information Technology (MIIT) and the license has not expired, according to China's Internet Management Regulations. Otherwise, CDN does not accelerate the domain name. | download.game-apk1.com |
| OBS bucket | OBS bucket whose version is 3.0 or later. | obs-doc-test |
Prerequisites
Static content, such as images and software packages, has been stored in an OBS bucket.
You can create a bucket and upload files to the bucket using the OBS console, OBS Browser, or SDK. For details, see OBS Documentation.
Procedure
- Enable CDN acceleration on the OBS console.
OBS supports domain name management. After a user-defined domain name is bound to an OBS bucket, the OBS bucket can be accessed using this domain name. In addition, CDN acceleration can be enabled during the binding without configuration on the CDN console.
- Log in to the HUAWEI CLOUD console. On the homepage of the management console, choose Service List > Storage > Object Storage Service.
The OBS console is displayed.
- Click the name of the bucket where software packages are stored, for example, obs-doc-test. The bucket management page is displayed.

- In the navigation pane, choose Domain Name Mgmt and click Bind User Domain Name.

- In the Bind User Domain Name dialog box, configure the domain name and CDN acceleration information.
- User Domain Name: Enter the domain name of the game website, for example, download.game-apk1.com.
- CDN Acceleration: Enable CDN acceleration.
- Service Type: Select a service type based on the application scenario.

- The default acceleration service area is Chinese mainland.
- By default, user domain names allow access requests over only HTTP.
- To use a bound user domain name to access OBS over HTTPS, configure an HTTPS certificate for the domain name on the CDN console.
- Click OK.
- Log in to the HUAWEI CLOUD console. On the homepage of the management console, choose Service List > Storage > Object Storage Service.
- Configure a CNAME record on DNS.
After the CDN acceleration function is enabled when the domain name is bound to OBS, CDN automatically generates a CNAME for the bound domain name. The CNAME record cannot be accessed directly. You must add the CNAME record to your domain's DNS records. Then requests for your domain name will be redirected to CDN nodes for acceleration. In this example, the automatically generated CNAME record is download.game-apk1.com.c.cdnhwc1.com. The CNAME configuration method varies depending on the DNS provider. In this document, DNS provided by HUAWEI CLOUD is used as an example. For details about how to configure CNAME records on other DNS providers, see Configuring a CNAME Record.
- Log in to the HUAWEI CLOUD console. On the homepage of the management console, choose . The DNS console is displayed.
- In the navigation pane, choose DNS Resolution > Public Zones. The public zone list is displayed.
- Click the domain name you want to add a record set to. In this example, the domain name is game-apk1.com.

- Click game-apk1.com. On the displayed page, click Add Record Set in the upper right corner. The Add Record Set dialog box is displayed.

- Set the parameters as prompted. Use the default values for the parameters that are not listed in the following table.
Parameter
Description
Example
Name
Domain name prefix
download
Type
Type of the record set
CNAME – Map one domain to another
Alias
Whether the record set will be associated with a cloud resource
No
Line
Resolution line. The DNS server will return the IP address of the specified line based on the source of visitors.
You must add a Default line to ensure that the website is accessible to users of all carriers.
Default
TTL (s)
Cache duration of the record set on a local DNS server. If your service address changes frequently, set TTL to a smaller value.
The default value is 300, which is, 5 minutes.
Value
Domain name alias
If CDN acceleration is not enabled, the value is the bucket domain name. If CDN acceleration is enabled, the value is the CNAME record generated by CDN.
download.game-apk1.com.c.cdnhwc1.com
- Click OK.
- Verify that the CNAME record has taken effect.
Open the Windows command line interface and run the following command:
nslookup -qt=cname User-defined domain name bound to the bucket
In this example, the user-defined domain name bound to the bucket is download.game-apk1.com. If the CNAME record generated by CDN is displayed, the CNAME configuration has taken effect.
- Enable private bucket retrieval on CDN. (Skip this step for public read or public read/write OBS buckets.)
If your OBS bucket is a private bucket, you must enable private bucket retrieval on the CDN console so that CDN can retrieve data from OBS. For details, see OBS Private Bucket Retrieval.
- If your OBS bucket policy is public read or public read/write, do not enable private bucket retrieval.
- If your private bucket contains resources that you do not want to make public, move the resources to another private bucket.
- Configure the file download URL.
Set the URL of the file to be downloaded in the code as follows: Domain name of the game website + Storage path of the file in the OBS bucket + File name.
In the following example, the game website's domain name download.game-apk1.com and the android.apk file under the game/3.2.1/ folder in the obs-doc-test bucket are used. Then the file download URL is as follows:
https://download.game-apk1.com/game/3.2.1/android.apk
- Verify the services.
After the game website is redeployed, log in to the website, browse web pages, and download games.
If images are displayed properly and the games are downloaded successfully, the acceleration configuration is successful.
Last Article: Configuration Process on the CDN Console
Next Article: Configuring a Policy for a Custom OBS Private Bucket
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.