indoleads.com
INCREASED PAYOUTS | EXCLUSIVE PROMOS | 3,000+ CPA offers | 180+ GEOs | All popular niches. Join now

Cloudfront VS Cloudflare

Partners.House

JackySan

Grand Guru
Joined
Dec 11, 2018
Messages
379
Hey,

I've seen quite a lot of people interested in using cloudfront these last few days on the forum.

I was wondering why one would use s3+cloudfront instead of s3+cloudflare?

cloudflare vs cloudfront​

Cloudfront is free for the 1st year only, then depending on your traffic volume, your monthly bill may become pretty high.
Especially with POP/Push, your traffic volume gets high very quickly, you can easily end up paying $500+ per month (I've seen it)

Cloudflare on the other hand is ALWAYS free - 100% free unless you want some of their premium features like phone support. It comes with free SSL as well.

Not only that, but Cloudflare also has more edge points around the world than Amazon's Cloudfront, so your visitors will likely get your data from a server closer to them when using Cloudflare:



Setting it up with S3 buckets is super easy - I just made a quick test and it worked immediately.

Here's how to do it (I'm only giving you a general overview here, if you're not familiar with cloudflare, Google each step for more details):

1/ Purchase a domain name and set the DNS records to use Cloudflare's DNS (if you use namecheap, they have a tutorial)

2/ In your S3 account, create a bucket files.yourdomain.com (replace yourdomain.com)

3/ In S3, enable the public READ permissions for that bucket

4/ In Cloudflare, go to the DNS tab, and add a CNAME record like this:



Then click "Add Record"

That's ALL!

From now, when you will access https://files.yourdomain.com it will access your S3 bucket at files.yourdomain.com.s3.amazonaws.com!

And https://files.yourdomain.com/any-file-name will access files.yourdomain.com.s3.amazonaws.com/any-file-name

I told you it was easy :D
 
Last edited by a moderator:
RollerAds
Hi Jacky,

Is there any difference if I use AWS-S3 + Cloudfare vs GoDaddy Ultimate+Cloudfare? I need to use Wordpress and I understand setting it up in AWS-S3 is more difficult.

I am looking to improve my WP hosting speed.

thanks,

Daniel
 
Hey Daniel,

You can't install wordpress on S3 at all, it's only for html and static assets.

I would stay away from Godaddy personally because of their hidden fees (you'll pay higher after 1 year) and servers speed.

ServandoSilva was recommending using Vultr, there is also DigitalOcean - both will give you better servers at much better price.
And you can find someone at fiverr to install your blog on Vultr or Digital Ocean for only $5

This gig for example: https://www.fiverr.com/ninja_tech/deploy-or-move-your-site-on-digitalocean-vultr

He will even setup your domain DNS to point to your server (you can maybe ask him to use Cloudflare for an extra $5, maybe even free not sure)
 
Last edited:
Hey Daniel,

You can't install wordpress on S3 at all, it's only for html and static assets.

I would stay away from Godaddy personally because of their hidden fees (you'll pay higher after 1 year) and servers speed.

ServandoSilva was recommending using Vultr, there is also DigitalOcean - both will give you better servers at much better price.
And you can find someone at fiverr to install your blog on Vultr or Digital Ocean for only $5

This gig for example: https://www.fiverr.com/ninja_tech/deploy-or-move-your-site-on-digitalocean-vultr

He will even setup your domain DNS to point to your server (you can maybe ask him to use Cloudflare for an extra $5, maybe even free not sure)

Yes, agreed. Godaddy is horrible..... Stay away.
 
Guys.... not sure what I am doing wrong here....



I entered this URL:

s3-us-west-2.amazonaws.com/domainname.com

I added the nameservers to my domain registrar.

 
The hostname is wrong - it's not the URL Amazon gives you that you should use o_O

It's your-bucket-name.s3.amazonaws.com AND it's crucial that your-bucket-name is the same as your CNAME+domain. If you don't use a subdomain, then your bucket name MUST be your domain name.
 
I've mentioned before that I use Cloudflare on pretty much all my projects...including affLIFT :)
 
This CloudFlare / S3 setup is yet to kick in for me. I haven't had much time to dick around with it so I just let it sit all day hoping it will propagate. But nothing's changed in almost 24 hours which I know is officially early, but still... Maybe it's a different issue? All I'm getting are GoDaddy parked pages.

I have two domains and I've decided to try and set one up with how JackySan said and the other with the URL as presented in some other guides online.

SO one now has www CNAME record www.domain.com.s3-website-us-east-1.amazonaws.com
The other has www CNAME as www.domain.com.s3.amazonaws.com

The only other DNS records are A for the naked domains pointing to some GoDaddy IPs.
Speaking of GoDaddy, over there are just two CloudFlare DNS servers.

I also set up three page rules in CloudFlare, all 301s to https://domain/$1 from:
http://domain.com/*
http://www.domain.com/*
https://www.domain.com/*

Crypto is set to flexible SSL.

Obviously, my goal is to use secure naked domains.

On the Amazon side, I have created both www.domain.com and domain.com buckets where the www is set to redirect to domain.com bucket as https. The content is in the domain.com bucket.

Checking my records on DNSChecker.org shows my A record but no CNAME propagation.

Btw, I've noticed that when I put
http://domain.com.s3-website-us-east-1.amazonaws.com/ in the browser, I see my index.html by default
Whereas when it's just http://domain.com.s3.amazonaws.com/ I have to add index.html as well to the URL

I can wait, that's fine, but it's not making sense.
Maybe someone has suggestions?
 
Can you check how the world sees your domain's DNS here? https://www.whatsmydns.net/

There's a way to test if your setup works BEFORE the DNS propagates though.

You can change your host file to force browsers to redirect any domain of your choice to any IP of your choice.

If you're on Windows, this file is C:\Windows\System32\drivers\etc\host

Open notepad as administrator, then open that file.

You can then enter a list of IP/host mapping.

You'll have to get s3.amazonaws.com IP for that, easy to do with https://ipinfo.info/html/ip_checker.php
I did it for you already :)

s3.amazonaws.com's IP is 52.216.128.147

So in your host file, add this line:

52.216.128.147 yourdomain.com

Save the file, open yourdomain.com in your browser and it will go to your S3 bucket if your setup works!
If that's the case, then you just need to wait more until the DNS propagates for everyone...
 
Something else, you're adding useless steps in your setup.

No need to create two S3 buckets (with and without www)

Since in cloudflare, you're redirecting all www traffic to non-www, then in the end it will never load your www S3 bucket.
 
Something else, you're adding useless steps in your setup.

No need to create two S3 buckets (with and without www)

Since in cloudflare, you're redirecting all www traffic to non-www, then in the end it will never load your www S3 bucket.

Ah, right! Yeah, makes sense :) There's nothing pointing to the www bucket anyway!

I'm on a Mac but I've dealt with the hosts file before when I was pirating some software LOL Yup, tested it like you said and it looks fine. I'm surprised that it's taking that long to propagate. Last time I saw such long propagation was in the 90s :p
 
Top