tencent cloud

All product documents
Cloud Object Storage
DocumentationCloud Object StorageSDK DocumentationC++ SDKSetting Access Domain Names (CDN/Global Acceleration)
Setting Access Domain Names (CDN/Global Acceleration)
Last updated: 2024-02-02 12:12:58
Setting Access Domain Names (CDN/Global Acceleration)
Last updated: 2024-02-02 12:12:58

Overview

This document describes how to use a non-default domain to request COS.

Default CDN acceleration domain name

Description

To use a default CDN acceleration endpoint to access COS, you need to enable the default CDN acceleration endpoint feature for your bucket in the COS console. For operation details, see Enabling Default CDN Acceleration Domain Names.

Sample request

qcloud_cos::CosConfig config("./config.json");
qcloud_cos::CosAPI cos(config);
// Replace `examplebucket-1250000000` with your bucket name.
CosSysConfig::SetDomainSameToHost(true);
CosSysConfig::SetDestDomain("examplebucket-1250000000.file.myqcloud.com");
Or you can modify config.json as follows:
"IsDomainSameToHost":true,
"DestDomain":"examplebucket-1250000000.file.myqcloud.com",

Custom CDN acceleration domain name

Description

To use a custom CDN acceleration domain name to access COS, you need to enable the custom CDN acceleration domain name feature for your bucket in the COS console. For operation details, see Enabling Custom CDN Accelerated Domain Name.

Sample request

qcloud_cos::CosConfig config("./config.json");
qcloud_cos::CosAPI cos(config);
// Replace `mycdndomain.com` with your CDN domain name.
CosSysConfig::SetDomainSameToHost(true);
CosSysConfig::SetDestDomain("mycdndomain.com");
Or you can modify config.json as follows:
"IsDomainSameToHost":true,
"DestDomain":"emycdndomain.com",

Custom origin server domain name

Description

To use a custom origin server domain name to access COS, you need to enable the custom origin server domain name feature for your bucket in the COS console. For operation details, see Enabling Custom Origin Server Domains.

Sample request

qcloud_cos::CosConfig config("./config.json");
qcloud_cos::CosAPI cos(config);
// Replace `mydomain.com` with your custom domain name.
CosSysConfig::SetDomainSameToHost(true);
CosSysConfig::SetDestDomain("mydomain.com");
Or you can modify config.json as follows:
"IsDomainSameToHost":true,
"DestDomain":"mydomain.com",

Global Acceleration Domain Name

Description

To use a global acceleration domain name to access COS, you need to enable the global acceleration domain name feature for your bucket in the COS console. For operation details, see Enabling Global Acceleration.

Sample request

qcloud_cos::CosConfig config("./config.json");
config.SetRegion("accelerate")
qcloud_cos::CosAPI cos(config);
Or you can modify config.json as follows:
"Region":"accelerate",

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon