Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Object Storage Service/ User Guide/ Domain Name Management/ Accessing a Bucket Using a User-Defined Domain Name

Accessing a Bucket Using a User-Defined Domain Name

Updated on 2024-11-05 GMT+08:00

After you upload a file to a bucket, OBS generates an access address for the file that includes the bucket's default domain name. Accessing this address using a browser will automatically download the file. To avoid exposing the default domain name of a bucket or to preview files online through a browser, you can bind a user-defined domain name to the bucket and use it to access the files in the bucket.

Scenarios

  • File preview: To avoid automatic file downloads, you can bind a user-defined domain name to a bucket for online file preview.
  • Preventing domain names from being blocked: Some application platforms may block the default domain name of a bucket. To access files in a bucket, you can bind a user-defined domain name to the bucket.
  • Keeping the access address unchanged: To keep website or file access addresses unchanged after a migration or storage location change, you can upload the files to a bucket and bind a user-defined domain name to the bucket. This will establish a mapping between the website domain name and the default bucket domain name. In this way, you can still access the files using the original address.
  • Improved brand image: Having a fixed and personalized domain name for accessing an enterprise website can make the enterprise appear more professional and reliable. This enhances enterprise image and improves customer experience.
  • Easy access: You can use a user-defined domain name that is easy to remember to access a bucket and files in the bucket.

Principles

The following describes the process of accessing objects in a bucket using a user-defined domain name and the process of accessing objects in a bucket using the default bucket domain name.

Figure 1 shows the process of accessing objects in a bucket using a user-defined domain name.

Figure 1 Using a user-defined domain name to access objects in a bucket
  1. A user enters a file access address (that includes a user-defined domain name) in the browser to initiate an access request.
  2. DNS maps the user-defined domain name to the default domain name of the bucket.
  3. DNS translates the default domain name of the bucket to the IP address of the OBS server.
  4. OBS returns the IP address of the server to the client.
  5. The client sends a request with the user-defined domain name specified in the Host header to the IP address of the OBS server.
  6. OBS identifies the user-defined domain name in the Host header and returns a response with Content-Disposition set to inline to the client, which indicates that the file is expected to be displayed in the browser.

Figure 2 shows the process of accessing objects in a bucket using its default domain name (bucketName.obs.endpoint.myhuaweicloud.com).

Figure 2 Using the default domain name of a bucket to access objects in the bucket
  1. A user enters a file access address (that includes the default domain name of the bucket) in the browser to initiate an access request.
  2. DNS translates the default domain name of the bucket to the IP address of the OBS server.
  3. OBS returns the IP address of the server to the client.
  4. The client sends a request with the default domain name specified in the Host header to the IP address of the OBS server.
  5. OBS identifies the default domain name in the Host header and returns a response with Content-Disposition set to attachment to the client, which indicates that the file is expected to be downloaded and saved locally.

Figure 1 shows the process of accessing objects in a bucket using a user-defined domain name.

Figure 1 Using a user-defined domain name to access objects in a bucket
  1. A user enters a file access address (that includes a user-defined domain name) in the browser to initiate an access request.
  2. DNS maps the user-defined domain name to the default domain name of the bucket.
  3. DNS translates the default domain name of the bucket to the IP address of the OBS server.
  4. OBS returns the IP address of the server to the client.
  5. The client sends a request with the user-defined domain name specified in the Host header to the IP address of the OBS server.
  6. OBS identifies the user-defined domain name in the Host header and returns a response with Content-Disposition set to inline to the client, which indicates that the file is expected to be displayed in the browser.

Figure 2 shows the process of accessing objects in a bucket using its default domain name (bucketName.obs.endpoint.myhuaweicloud.com).

Figure 2 Using the default domain name of a bucket to access objects in the bucket
  1. A user enters a file access address (that includes the default domain name of the bucket) in the browser to initiate an access request.
  2. DNS translates the default domain name of the bucket to the IP address of the OBS server.
  3. OBS returns the IP address of the server to the client.
  4. The client sends a request with the default domain name specified in the Host header to the IP address of the OBS server.
  5. OBS identifies the default domain name in the Host header and returns a response with Content-Disposition set to attachment to the client, which indicates that the file is expected to be downloaded and saved locally.

Constraints

Table 1 Constraints

Item

Description

Bucket version

Only buckets whose version is 3.0 or later support user-defined domain names. The bucket version can be viewed in the Basic Information area of the bucket's Overview page on OBS Console.

Number of domain names

By default, a bucket can have up to 20 user-defined domain names bound.

Functions

  • User-defined domain names currently only allow requests over HTTP.

    If you want to use a user-defined domain name to access OBS over HTTPS, you need to configure CDN and manage HTTPS certificates on the CDN console.

    For details, see Configuring an HTTPS Certificate.

  • A user-defined domain name can be bound to only one bucket.
  • Chinese domain names are not supported.
  • The suffix of a user-defined domain name can contain 2 to 6 uppercase or lowercase letters.
  • As required by the MIIT, if the bucket which a user-defined domain name is bound to is in a Chinese mainland region, you must complete the ICP filing.
NOTE:

If an acceleration domain name is also required, to prevent objects in OBS buckets from being directly downloaded upon access, you need to perform other required operations after the user-defined domain name and the acceleration domain name have been configured. For details, see With CDN Acceleration Enabled, Why Are the Objects in My OBS Bucket Directly Downloaded When I Access Them?

Prerequisites

  • There is a bucket with objects. For details, see Creating a Bucket.
  • There is a second-level domain.
  • As required by the MIIT, if the bucket which a user-defined domain name is bound to is in a Chinese mainland region, you must complete the ICP filing.

Configuring a User-Defined Domain Name

You can use OBS Console, APIs, or SDKs to configure user-defined domain names.

Follow-Up Operations

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback