A static site (HTML, CSS, images, and client-side scripts, with no server-side code like PHP or a Node backend) can be served straight out of a bucket, once its objects are reachable over the internet. A static site on E2E Object Storage is a bucket with Public Access turned on and your site’s files uploaded to it, each reached by its object URL.
Create the bucket and upload your site
Section titled “Create the bucket and upload your site”Create a bucket, then upload your site’s files to it, keeping the same folder structure your site expects.
Make the website reachable
Section titled “Make the website reachable”Turning on Download opens every file in the bucket to anyone who has its address, so keep only the site’s own files in this bucket.
Open the bucket’s Permissions tab, click Public Access Config, check Download, and
click Save Permission. Anyone can now retrieve a file by its object URL. Each file is
reachable at
https://objectstore.e2enetworks.net/<bucket-name>/<file-path>, or the equivalent Chennai
address from S3 compatibility if
that is where your bucket is.
Check the site in a browser
Section titled “Check the site in a browser”Open your home page’s address in a private browser window: the address from Make it reachable, with your home page’s file name as the file path. The page loads with its styles and images. A file that fails to load usually has a different path in the bucket from the one the page asks for; check the folder structure you uploaded.
(Optional) Add a CDN
Section titled “(Optional) Add a CDN”A CDN serves your site’s files from edge locations around the world, so visitors far from your bucket’s region get them from a location near them. Your account must have CDN turned on first; see Request CDN.
- In the bucket’s Permissions tab, click Public Access Config, check Listing as well as Download, and click Save Permission. Add to CDN needs both; with Download alone, you get Public Access Required.
- In the bucket’s Actions menu, choose Add to CDN.
- Origin Domain Name is filled in with your bucket’s address and cannot be changed.
- Leave Origin path empty to serve the whole bucket. The bucket’s name is already part of
Origin Domain Name, so entering
/<bucket-name>makes the CDN look for a folder of that name inside the bucket, and your files get an HTTP 404 error. - Origin ID fills in for you; keep it as it is.
- Click Create CDN.
Create CDN creates a distribution for your bucket, which serves your files at its own address, its Distribution URL. A new distribution can take up to 30 minutes to deploy. It shows InProgress while it deploys, then Deployed. It also shows Enabled or Disabled: Enabled means it serves requests. Once the CDN is attached, the bucket gets a Bucket CDN tab of its own in its detail panel. For each step and how to find a file’s CDN address, see Serve a bucket through the CDN.
Once the distribution is created, set Default Root object to your home page’s file name, such as index.html, so that your home page loads at the Distribution URL’s root address. A new distribution has none. See Change the basic settings.
Add to CDN needs Listing, which lets anyone see the names of all the files in the bucket.
To keep the names private once the distribution is created, open the bucket’s Permissions tab,
click Public Access Config, clear Listing, keep Download checked, and click
Save Permission. Your site keeps loading through the CDN. If the CDN served the list before you
closed it, clear the cache for the path / with Flush Cache on the distribution’s Invalidations tab; see
Serve a bucket through the CDN.
A bucket’s distribution always uses the E2E certificate, so it serves your site at its Distribution URL, not at a domain name of your own.
Update your site once the CDN is live
Section titled “Update your site once the CDN is live”The CDN caches your files, so a new version of a file you upload to the bucket reaches visitors once the cached copy expires. To serve the new version sooner, clear the cache for the paths you changed: in MyAccount, under Network, click CDN, click the distribution on Manage CDN Services, open its Invalidations tab, and click Flush Cache. See Clear the cache.
To update the site, upload the changed files over the old ones. For what public access opens up and how to close it again, see Make a bucket public.