How to host a static website with HTTPS on AWS, using S3 and CloudFront
Amazon’s AWS is an inexpensive and limitlessly scalable platform that can be ideal for hosting fast, secure, and reliable static websites. I host several sites using the method described below, and it costs me pennies per month. The only problem is that getting things set up–especially with HTTPS support–isn’t exactly straightforward.
- We’ll create and configure two S3 buckets. One will serve static content via S3. The other will be used simply to redirect
- We’ll create an SSL certificate using AWS Certificate Manager.
- We’ll set up two CloudFront distributions which will use the S3 buckets as origins. (The website itself will be served through CloudFront’s edge locations, but the files will be stored on S3.)
- We’ll set up DNS alias records which point to CloudFront, using Route 53.
- Create two buckets in S3. It doesn’t...
Continue reading →