Endpoints

Last Updated: Dec 07, 2017

Composition rules for domain names

In terms of all network requests for OSS, except those for the GetService API, the domain names are the third-level domain names with specified bucket information.

The domain name is composed of a bucket name and endpoint: BucketName.Endpoint. An endpoint is the access domain name for the OSS to serve externally. OSS provides services to the external through HTTP RESTful APIs. Different regions use different domain names. An endpoint includes intranet and Internet access domain names. For example, the Internet endpoint of China East 1 is oss-cn-hangzhou.aliyuncs.com, and the intranet endpoint is oss-cn-hangzhou-internal.aliyuncs.com. For more information, see Regions and endpoints.

How to access OSS through Internet

Inbound traffic (write) is free, and outbound traffic (read) generated through Internet access is charged. For more information, see Pricing.

Two methods for accessing OSS through Internet are available:

  • Method 1 : During the access, the OSS resource is expressed in URL format. Construction of OSS URLs:

    1. <Schema>://<Bucket>.<Internet Endpoint>/<Object> Third-level domain name access method
    2. Schema: Value of HTTP or HTTPS
    3. Bucket: Your OSS storage space
    4. Endpoint: The access domain name for a bucket's data center. Enter the Internet endpoint here.
    5. Object: A file uploaded to the OSS.

    For example, in China East 1, your bucket name is abc, and object is myfile/aaa.txt. Your Internet access address is:

    1. abc.oss-cn-hangzhou.aliyuncs.com/myfile/aaa.txt

    You can directly use object URL links in HTML:

    1. <img src="https://abc.oss-cn-hangzhou.aliyuncs.com/mypng/aaa.png" />
  • Method 2 : Configure the Internet access domain name through OSS SDK.

    The OSS SDK has spliced an access domain name for each of your action. However, you must set different endpoints when operating buckets of different regions. You must set the endpoint during class instantiation before configuring buckets on the China East 1 node:

    1. String accessKeyId = "<key>";
    2. String accessKeySecret = "<secret>";
    3. String endpoint = "oss-cn-hangzhou.aliyuncs.com";
    4. OSSClient client = new OSSClient(endpoint, accessKeyId, accessKeySecret);

How to access OSS through intranet

Intranet refers to internal communication networks among Alibaba Cloud products. For example, you access OSS through ECS or configure the OSS intranet access domain name to carry out origin retrieval through Alibaba Cloud CDN. The inbound/outbound traffic generated in intranet is free. For more information, see Pricing.

Two methods for accessing OSS through intranet are available:

  • Method 1 : During the access, the OSS resource is expressed in URL format. Construction of OSS URLs:

    1. <Schema>://<Bucket>.<Intranet Endpoint>/<Object> Third-level domain name access method
    2. Schema: Value of HTTP or HTTPS
    3. Bucket: Your OSS storage space
    4. Endpoint: The access domain name for a bucket's data center. Enter the intranet endpoint here.
    5. Object: A file uploaded to the OSS.

    For example, in China East 1, your bucket name is abc, and object is myfile/aaa.txt. Your intranet access address is:

    1. abc.oss-cn-hangzhou-internal.aliyuncs.com/myfile/aaa.txt
  • Method 2 : Configure the intranet access domain name using OSS SDK through ECS.

    For example, the intranet endpoint configured for Java SDK on the ECS cloud server is modified:

    1. String accessKeyId = "<key>";
    2. String accessKeySecret = "<secret>";
    3. String endpoint = "oss-cn-hangzhou-internal.aliyuncs.com";
    4. OSSClient client = new OSSClient(endpoint, accessKeyId, accessKeySecret);

    Note : The intranet between ECS and OSS in the same region is interconnected, whereas the intranet between ECS and OSS in different regions is not interconnected.

    For example, you have purchased ECS of China North 2 (Beijing), and its OSS includes two buckets:

    • One of the buckets is beijingres, and the region is China North 2, beijingres.oss-cn-beijing-internal.aliyuncs.com can be used to access beijingres resources in ECS of China North 2.

    • The other bucket is qingdaores, and the region is China North 1, the intranet address, qingdaores.oss-cn-qingdao-internal.aliyuncs.com cannot be used to access OSS in ECS of China North 2. The Internet address qingdaores.oss-cn-qingdao.aliyuncs.com is required to access OSS.

Thank you! We've received your feedback.