siebenj
February 20, 2023, 9:57am
1
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.
brian
February 20, 2023, 10:58am
2
Fly.io already exposes the Fly-Region
request header! More info here .
siebenj
February 20, 2023, 1:17pm
3
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.
greg
February 20, 2023, 2:43pm
4
@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:
Some services like Fastly or Cloud Front are able to provide city based headers. I know there’s nothing in the docs about it, but does one of your upstream providers (like DNS routing) provide any of this info?
Happy to share my use case if you’d like.
I ended up putting Cloudflare in front just to get those headers. Far from ideal, but it worked.
siebenj
February 20, 2023, 2:58pm
5
Thanks @greg as you say, while not ideal, it’ll do for now!
1 Like