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
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 >
WordPress is an extremely versatile platform which gives the admin user a lot of flexibility. Being flexible is not always a good thing. The Admin user can easily make changes to the site code and if compromised by a hacker it can be a very long and painful road to recovery. But there are several steps you can […]More >
Looking to quickly integrate Mailchimp API V3 with code igniter? I’ve taken this API wrapper and converted it into a library for CI so you can quickly integrate it into your project. Step 1: Download this file and add it into your application/libraries folder. On line 185 I have manually overridden the timeout value as it was always […]More >