Feature request: Gelocation headers

I saw this: IP Geolocation for Serverless Functions – Vercel and would absolutely love if fly.io could provide something like this as well.

In a nutshell, they provide helpful headers like

X-Vercel-IP-Country: JP
X-Vercel-IP-Country-Region: 13
X-Vercel-IP-City: Tokyo

I’m guessing fly already has at least some of this data anyway to enable routing to the correct region instance.

Fly.io already exposes the Fly-Region request header! More info here.

Thanks but not quite what I was looking for - AFAIK this only gives me the general region, not the exact country or city (although I know the latter is usually impossible to get right with IP address alone). Having the country the user connected from would be very helpful.

@siebenj it’s something I was looking for a while back too. A bit more about that and why Fly don’t (currently) provide that:

I ended up putting Cloudflare in front just to get those headers. Far from ideal, but it worked.

Thanks @greg as you say, while not ideal, it’ll do for now!

1 Like

Vercel uses (or used) maxmind, but I hear https://ipinfo.io/ is more accurate and are amenable to negotiation prices for enterprise use cases. Say providing geoip headers to all their customers. Loading up a free version of maxmind for ourselves and shipping 300mb is rough (never mind reading it on every request). If I was operating a global routing layer it would be a lot easier as my machines would be a lot bigger.

Source: I used to run a global https routing layer.

1 Like