Geo
Geo steering directs traffic to pools tied to specific countries, regions, or — for Enterprise customers only — data centers.
This option is extremely useful when you want site visitors to access the endpoint closest to them, which improves page-loading performance.
You can assign multiple pools to the same area and the load balancer will use them in failover order. Any options not explicitly defined — whether in data centers, countries, or regions — will fall back to using default pools and failover.
Cloudflare has 13 geographic regions that span the world. The region of a client is determined by the region of the Cloudflare data center that answers the client’s DNS query.
When creating or editing a load balancer:
- Go to the Traffic steering step.
- Select Geo steering.
- For Region, select a region > Add Region.
- Select Edit.
- Select a pool > Add Pool.
- If adding multiple pools, re-order them into your preferred failback order.
- (optional) Add more regions if needed.
Use the regions_pool
property of the Update Load Balancers command to specify an array of regions. Specify each region using the appropriate region code followed by a list of endpoints to use for that region.
In the example below, WNAM
and ENAM
represent the West and East Coasts of North America, respectively.
If you only define WNAM
, then traffic from the East Coast will be routed to the default_pools
. You can test this using a client in each of those locations.
When creating or editing a load balancer:
- Follow the create a load balancer procedure until you reach the Traffic steering step.
- Select Geo steering.
- For Country, select a country > Add Region.
- Select Edit.
- Select a pool > Add Pool.
- If adding multiple pools, re-order them into your preferred failback order.
- (optional) Add more countries if needed.
When creating a load balancer via the API, include the country_pools
object to map countries to a list of pool IDs (ordered by their failover priority).
To get a list of country codes, use the Region API.
Any country not explicitly defined will fall back to using the corresponding region_pool
mapping (if it exists), then to the associated default pools.
When creating a load balancer via the API, include the pop_pools
object to map Cloudflare data centers to a list of pool IDs (ordered by their failover priority).
For help finding data center identifiers, refer to this community thread ↗.
Any data center not explicitly defined will fall back to using the corresponding country_pool
, then region_pool
mapping (if it exists), and finally to associated default pools.
A fallback pool will be used if there is only one pool in the same region and it is unavailable. If there are multiple pools in the same region, the order of the pools will be respected. For example, if the first pool is unavailable, the second pool will be used.