tencent cloud

Feedback

Setting Access Domain Names (CDN/Global Acceleration)

Last updated: 2024-02-02 14:36:36

    Overview

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

    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.

    Sample code

    CosXmlConfig config = new CosXmlConfig.Builder()
    .SetRegion("COS_REGION") // Sets the default bucket region
    // Set the requested endpoint to “your.domain.com”
    .SetHost("your.domain.com") // Custom endpoint
    .Build();
    Note:
    For the complete sample, go to GitHub.

    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.

    Sample code

    CosXmlConfig config = new CosXmlConfig.Builder()
    .SetEndpointSuffix("cos.accelerate.myqcloud.com")
    .Build();
    Note:
    For the complete sample, go to GitHub.

    Custom CDN domain name

    The sample code below shows how to access a COS service using a custom CDN acceleration domain name.

    Sample code

    CosXmlConfig config = new CosXmlConfig.Builder()
    .SetHost("exampledomain.com")
    .Build();
    Note:
    For the complete sample, go to GitHub.

    Default CDN domain name

    The sample code below shows how to access a COS service using a default CDN acceleration domain name.

    Sample code

    CosXmlConfig config = new CosXmlConfig.Builder()
    .SetEndpointSuffix("file.myqcloud.com")
    .Build();
    Note:
    For the complete sample, go to GitHub.
    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