Principles of static website hosting
OBS allows static websites to be hosted on buckets and supports index page, error page display, and page redirection. After static website hosting is enabled, users can access objects in a bucket by using either of the following methods:
- Resource management: Users can access objects in a bucket through REST API using a common domain name. In this mode, users can perform uploading, downloading, deleting, and listing operations on buckets or objects.
- Static website: Users can access objects in a bucket by using a specific domain name. In this mode, display of the index page, error pages and requested pages is implemented according to the configured static domain name hosting rules.
The modification of static website hosting takes effect within two minutes. Then users can access static resources using the following access domain names:
https://bucket name.static website hosting domain name/object name http://bucket name.static website hosting domain name/object name
Avoid using periods (.) in the destination bucket name. Otherwise, failures in client authentication certificate may occur when users use HTTPS for access.
To allow your clients to access the content on the website terminal node, you must make all of your content public and accessible. You can use bucket policies or ACLs on objects to grant necessary permissions.
The differences between the resource management mode and static website mode are as follows:
|
Major Difference |
Resource Management |
Static Website |
|---|---|---|
|
Access control |
Both public content and private content are supported. |
Only public content is supported. |
|
Error message processing |
An error response in XML format is returned. |
An HTML document is returned. |
|
Redirection support |
N/A |
Both object-level and bucket-level redirection are supported. |
|
Supported request |
Operations on all buckets and objects are supported. |
Only GET and HEAD requests on objects are supported. |
|
Response to GET and HEAD requests of bucket root level |
List of object keys in a bucket is returned. |
Index file specified in the configuration is returned. |
Last Article: Static Website Hosting
Next Article: Configuring static website hosting
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.