- The index and error files must be located at the root of your bucket, rather than in a folder.
- When Bucket Website is enabled, a default bucket policy is applied. All objects in the bucket then become publicly visible. You can create your own bucket policy to change the visibility settings via CLI.
How to enable and use the bucket website feature
The Bucket Website feature allows you to host static websites using Scaleway Object Storage.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- A valid API key
- An Object Storage bucket
How to enable the bucket website feature
-
Click Object Storage in the Storage section of the side menu. The list of your buckets displays.
-
Click the name of the bucket you wish to host your website on.
-
Click Enable bucket website in the bucket settings tab. A pop-up appears.
-
Click the «Toogle Icon» icon to enable the feature.
-
Enter the names of the index and error files of your website.
The index and error files are commonly named
index.html
anderror.html
, respectively. You may have already uploaded these files to your bucket, or you can upload them later. Either way, their names and paths must be specified at this step.Important -
Click Save configuration to confirm. The details of your website configuration display.
You can now upload the index and error files to your bucket, if you have not already done so, as well as the other files that make up your static website.
TipUse the drag and drop area to upload several files and folders at the same time.
-
Access the website by clicking the Website URL from the Bucket settings tab.
NoteYou can also configure a CNAME record for your bucket URL to access the website through a domain name of your choice.
Sample HTML files
Use the samples below to quickly create HTML files for testing purposes.
Here is an example of a basic index.html
file:
<!doctype html><html><head><title>My Website</title></head><body><div id="main"><h1>Hi! Welcome to my website.</h1></div></body></html>
Here is an example of a basic error.html
file:
<!doctype html><html><head><title>Oops!</title></head><body><div id="main"><h1>Oops! Something went wrong.</h1></div></body></html>