Atif T.
Atif T.

Reputation: 9

Website through AWS S3 Bucket returns a 404

I'm trying to publish my static HTML, CSS, and JS website through AWS S3 bucket. However, I'm running into several issues. After purchasing my domain, I created an S3 bucket called 'drainleaf' and then following the AWS Youtube tutorial, I tried to publish my site.

However, I'm getting some errors. I uploaded my site folder in the 'Overview' tab of S3. Then, inside the properties tab, I added my index.html file. Lastly, i added bucket policy in Permissions Tab.

I'm getting a 404 not found error when i visit the domain. Below are the links to the screenshots for context:

enter image description here

enter image description here

enter image description here

enter image description here

Upvotes: 0

Views: 2123

Answers (1)

Chris Williams
Chris Williams

Reputation: 35146

The problem is for you to use your S3 bucket like this, you need to name the S3 bucket after the domain it will be used on.

So in your case it's a 404 because the bucket name of your domain does not exist.

2 solutions to resolve this:

  • Create a new S3 bucket and give it the name of your domain name.
  • Create a CloudFront Distribution in front of your S3 bucket, if you do this you can get a free SSL via ACM so you can serve your website over https.

Upvotes: 2

Related Questions