Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTPS for Amazon S3 static website [closed]

I want to host a HTTPS-only static website using Amazon S3 and CloudFront. Here's what I've done so far:

  1. Set up an S3 bucket for static website hosting and put my website files in it
  2. Created a CloudFront distribution and pointed it to the S3 bucket
  3. Added a CNAME record in my domain's nameservers for the www subdomain pointing to the CloudFront bucket.

So far, so good - I can access my website using the www.example.com address. However, I want the site to be available via HTTPS only, for which I bought an SSL certificate from GoDaddy.

Now, the question is:

  1. Is there a way to install this third-party SSL certificate on my S3-hosted website?
  2. Is there a way to have an automatic http to https redirect with this setup?
like image 993
jamix Avatar asked Mar 30 '13 14:03

jamix


People also ask

Can you use HTTPS with S3?

You'll want to use your new SSL certificate with your S3 bucket by linking them with CloudFront, a content delivery network (CDN) service that can also add HTTPS to your S3 resources.To activate CloudFront,go to the CloudFront Dashboard and click “Create Distribution,” — you'll then be taken to a few pages of settings.

Can Amazon S3 run a static website?

You can use Amazon S3 to host a static website. On a static website, individual webpages include static content. They might also contain client-side scripts. By contrast, a dynamic website relies on server-side processing, including server-side scripts, such as PHP, JSP, or ASP.NET.


1 Answers

Yes, as of today you can do it at no charge.

You can now use HTTPS with CNAMEs on CloudFront as it now supports custom SSL certificates using Server Name Indication (SNI): http://aws.typepad.com/aws/2014/03/server-name-indication-sni-and-http-redirection-for-amazon-cloudfront.html

I managed to set up a free Class 1 StartSSL cert for my CloudFront distributed static site on S3 without too much trouble (see: CloudFront error when serving over HTTPS using SNI).

like image 84
wikichen Avatar answered Oct 07 '22 05:10

wikichen