AWS S3 - Static Website Hosting
- Amazon S3 can be used to host static websites, providing a cost-effective and highly scalable solution for hosting web content. Static websites include HTML, CSS, JavaScript, images, and other static files that do not require server-side processing.
Steps to Host a Static Website on Amazon S3:
- Create one S3 bucket
Click on bucket > Properties > Static website hosting (on bottom) > edit and enable it.
Then select Host a static website > Name of index & error document.
Add Redirection rule > Save changes.
It will generate static hosting website url. But in order to access this, go to
Bucket > Permissions > bucket policy > edit and add policy.
We can use policy generator.
But still not able to access static website hosting url and getting 404 not found error.
So now we have to create and upload index.html file in bucket here.
Created one html file and upload it into S3 bucket.
Now, we will click on url created on. Static website hosting section.
So we can host sample static website on S3 with above steps.