tencent cloud

All product documents
Cloud Object Storage
DocumentationCloud Object StorageSDK DocumentationMini Program SDKSetting Access Domain Names (CDN/Global Acceleration)
Setting Access Domain Names (CDN/Global Acceleration)
Last updated: 2024-02-04 17:20:25
Setting Access Domain Names (CDN/Global Acceleration)
Last updated: 2024-02-04 17:20:25

Overview

This document describes how to request a COS service using a non-default COS endpoint.

Parameter description

You can use initialization parameters to configure the request domain name. Parameters involved are described as follows. For more initialization parameters, please see Configuration items in Getting Started.
Parameter
Description
Type
Required
Domain
The custom request domain name used to call a bucket or object API. You can use a template, such as "{Bucket}.cos.{Region}.myqcloud.com" which will use the bucket and region passed in the replacement parameters when an API is called.
String
No
Protocol
The protocol used when the request is made. Valid values: https:, http:. By default, http: is used when the current page is determined to be in http: format; otherwise, https: is used
String
No

Default CDN acceleration domain name

The sample code below shows how to access a COS service using a default CDN acceleration domain name.
var cos = new COS({
Domain: '{Bucket}.file.myqcloud.com', // Custom acceleration domain name (supports using a template). In this sample, the value of {Bucket} will be replaced by the value passed in the request.
Protocol: 'https:', // Request protocol, which can be 'https:' or 'http:'
});

Custom CDN Acceleration Domain Name

The sample code below shows how to access a COS service using a custom CDN acceleration domain name.
var cos = new COS({
Domain: 'example-cdn-domain.com', // Custom acceleration domain name
Protocol: 'https:', // Request protocol, which can be 'https:' or 'http:'
});

Custom origin server domain name

For more information, see Enabling Custom Origin Domain.
The sample code below shows how to access a COS service using a custom origin server domain name.
var cos = new COS({
Domain: 'example-cos-domain.com', // Custom origin server domain
Protocol: 'https:', // Request protocol, which can be 'https:' or 'http:'
});

Global acceleration endpoint

For more information on global acceleration, see Overview.
The sample code below shows how to access a COS service using a global acceleration endpoint.
var cos = new COS({
UseAccelerate: true, // Set this parameter to “true” to use a global acceleration domain.
Protocol: 'https:', // Request protocol, which can be 'https:' or 'http:'
});

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