Easy way to Configure SSL for Amazon S3 bucket via Cloudflare
Amazon S3 storage is great for off-loading static content such as images & scripts away from your main server, it’s even better (SEO-wise) when you set it to serve images from your domain name. Eg:
Unfortunately, if you were running an online shop and wanted to use SSL (HTTPS://) with this, you have to shell out a hefty $600 per month via AWS Cloudfront to get this added to your domain or subdomain… Which is a tad on the expensive side. Not only that, but if you have a high traffic website, you could be up for significant traffic charges from Amazon.
Being the tight arse that I am I started to investigate other options, and I stumbled across a cost effective solution while testing CloudFlare (not to be confused with Cloudfront). Not only does this allow you to run SSL via a subdomain on an Amazon Bucket it also allows you to use the CloudFlare CDN and security features to keep your traffic costs down for a tiny
$20 per month (or as low as $5 per month for additional sites) $0 per month (now included in Cloudflares free plan).
$0 VS $600? How did I do it? Read on…
How Configure SSL for Amazon S3 bucket via CloudFlare:
First, create your Bucket on Amazon S3. Make sure the bucket name is the same as the domain or subdomain you’re wanting to run CloudFlare SSL on.
Now click into the bucket, and select “Properties”. Under “Static Website Hosting” enable website hosting and enter an index document name such as index.html. Copy the “Endpoint” url as you will need this later for the CloudFlare DNS configuration.
Now you are going to want to register for a CloudFlare
Pro account, as the free account does not give you SSL. Add your domain name and start the setup process.
Once you get to the DNS setup section you are going to need to add a new CNAME record that points to the S3 endpoint we copied before. In the case of images.yourwebsite.com you would create a new DNS record for the subdomain “images” and alias that to your endpoint: Images.yourwebsite.com.s3-website-ap-southeast-2.amazonaws.com
Ensure CloudFlare is enabled on the subdomain by clicking on the grey cloud and making it orange.
Now hit “Save” and wait for a bit for the changes to propagate.
You now need to enable “Flexible SSL” on your main domain. Click to CloudFlare settings and scroll down to SSL and select “Flexible SSL” and hit “Save”.
Now go grab a coffee as it takes an hour or so for everything to take effect. But once it kicks in your S3 bucket should now be serving superfast content via HTTPS for the low price of
$20 $0 per month VS Amazons Cloudfronts $600 + traffic costs. Woohoo.
You can also now benefit from the rest of CloudFlare’s features that can significantly speed up your website.Tags: amazon web services, cloudflare, amazon aws, amazon s3
Over the years websites have become extremely complex beasts. They now consist of many plugins and other software libraries from 3rd parties that require constant updating to remain secure. If you have ever come across a hacked website, chances are someone hasn’t updated it for a while, and a vulnerability was discovered and exploited. If […]More >
How Programmatic, Marketing Automation and Database Segmentation should be driving your sales funnel.
I had an interesting conversation recently with the head of a very well respected, independent creative agency. Part of the conversation was me explaining how, 7 years ago we pitched a 5 year plan to a clothing retailer that focused on community/database growth via content and targeted communications, with the end goal being a much […]More >
Front End Developer / WordPress As the main front end and WordPress Developer you will work closely with the IT team to enhance customer experience and drive digital revenue. We need someone who can: Take a PSD design, code, test and deploy new WordPress based products and services, with high quality experience for users Build […]More >
Design matters Design is the approach we use to solve problems in the most efficient manner. It’s a systematic and intuitive way of finding the best solution. An iterative process that allows us to explore a wide range of ideas always with the end user in mind. As Jennifer Kilian, VP of of McKinsey Digital […]More >
So you need a new website? Your existing website is looking old and tired and its time to retire ye’ old faithful. It’s tempting to browse around for a new WordPress template, change the images, write some new content, add your logo and voila! All done. (Much easier than a custom built website!) But chances […]More >