4

Is there a way to point CloudFront to different origin servers based on location?

We currently use Route53 latency-based routing to direct traffic to east or west region elastic load balancers. If we deploy CloudFront, it sounds like the distribution requires us to choose a single elastic load balancer as the origin.

1 Answer 1

7

The distribution only requires you to provision a hostname as the origin. As long as that hostname happens to be able to route traffic to your origin, CloudFront doesn't need to have an awareness of what specifically it is or how it works. (The exception is when the origin is S3.)

For that host, you'd use essentially what you're using now, but on the back side of CloudFront -- latency-based routing on the hostname you configure as the origin server, the back-end destination that CloudFront uses to access the origin. Each CloudFront edge location resolves that hostname independently in DNS and should receive responses most appopriate for the particular CloudFront edge location's physical location.

CloudFront, as you likely know, already georaphically routes incoming request to the nearest edge location using DNS, so your users will be hitting an edge location near them, and then CloudFront will be using the latency-based answer from Route 53, to access the most proximate regional system in your setup.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.