cscan
cscan

Reputation: 3850

Enabling SSL for S3, serve index.html by default

I have an S3 bucket with which I want to use SSL. I also want to serve up index.html by default.

When accessed over http, my-bucket.s3-website-us-west-2.amazonaws.com/ serves up index.html. However, AWS doesn't maintain an SSL certificate for this subdomain so it cannot be accessed over SSL. AWS does maintain an SSL certificate for my-bucket.s3.amazonaws.com/ which does resolve, as expected. But, that domain doesn't serve up index.html by default (even though index.html is set as the index document).

Is there a solution to this problem that does not require CloudFront (which is currently set up) or flexible SSL with CloudFlare? I'm trying to reduce the cost without sacrificing security.

Upvotes: 3

Views: 694

Answers (1)

Matt Houser
Matt Houser

Reputation: 36113

When using the "Static Website Hosting" option for hosting websites from S3, only HTTP can be used. HTTPS is not supported. This is done using the my-bucket.s3-website-* URL.

The my-bucket.s3.amazonaws.com endpoint is not an endpoint for serving up a website. It's simply an endpoint for the S3 API. This is why it supports HTTPS. So you can GET, POST, etc. to this endpoint when you're authenticated (or as anonymous if public ACLs are configured).

But it's not a website endpoint and won't serve index.html or the 404 page automatically.

To act as a website and use SSL, you must use a fronting service such as CloudFront.

Upvotes: 2

Related Questions