I’m in need of some clarification how cloudflare handles country-of-origin-based routing.
consider a number of imageservers that go by img1.domain.tld, img2.domain.tld … plus images.domain.tld
images.domain.tld is a loadbalancer, that assigns img*.domain.tld based on geoip location to ensure least distance between user and imageserver.
On top of this configuration, a siteowner wants to put all these servers behind cloudflare protection. The cf service assigned a specific ip to all of them, lets say 126.96.36.199 and 188.8.131.52,
now each img*.domain.tld and images.domain.tld have both 184.108.40.206 and 220.127.116.11 in their A records.
The observation is now, that users from europe get assigned img1.domain.tld, users from the US get img2.domain.tld
images.domain.tld is in europe, so european users get good speeds. users from the US however see loading times up to 10 seconds.
When both run traceroutes to all domains, the last target entry is 18.104.22.168 and 22.214.171.124 respectively.
I have a slight feeling, that the inclusion of the cloudflare ip (the same ip for all image servers) nullifies the benefits of the geolocation balancing mechanism. Is this a wrong assumption?
What is the best configuration for this case? I am confused on how cloudflare handles this and where my confusion might stem from.