I've registered a domain through Route 53. This is what my records look like in Route 53:
fakeelias.ca. A #.#.#.#
fakeelias.ca. NS brett.ns.cloudflare.com
roxy.ns.cloudflare.com
fakeelias.ca. SOA ns-####.awsdns-17.org. awsdns-hostmaster.amazon.com.
staging.fakeelias.ca. A #.#.#.#
www.fakeelias.ca. A ALIAS fakeelias.ca. (z1pgzi762j7wmn)
To get the Cloudflare working in front of my s3 buckets I had to replace the NS entry with the what Cloudflare gave me and now my CNAME mappings for my buckets work through Cloudflare.
What's not working are my paths fakeelias.ca, www.fakeelias.ca and staging.fakeelias.ca.
I want to use latency based routing through Route 53 for those so that fakeelias.ca will point to the nearest NGINX server. staging.fakeelias.ca will point to my NGINX staging server. Are the NS entries for Cloudflare messing this up? I'm kinda new to this DNS stuff.
Update for 9/2016:
Cloudflare has now released their Traffic Manager feature that can do global load balancing and health checks: https://blog.cloudflare.com/cloudflare-traffic-manager-the-details/
Yes, you can use Cloudflare as the CDN edge/proxy and Route53 for the routing behind it.
You need to have 2 different domain names for this to work, one for Route53 and the other with Cloudflare.
Setup Route53 to route your queries to the servers you want using a record set (like routing.example.com
pointing to US and Europe servers). Read Route53 documentation for details on how to do this. This domain will only be accessed by Cloudflare so it can be any random cheap name.
Setup Cloudflare with the public domain for your website and enter a CNAME record pointing to the Route53 domain name you setup above. Cloudflare's servers will then follow the CNAME and be routed to the right server using Route53 rules. Ensure that Cloudflare proxying (the orange cloud) is enabled.
Each Cloudflare datacenter will lookup and cache the DNS responses locally so geographic routing will work fine. Even if you aren't using Cloudflare to proxy the traffic to your site, there are still benefits in using them
I used this setup for both geographic load balancing (sending to the closest server) as well as global round-robin (spreading load randomly) on a service doing billions of requests a month and everything worked well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With