1

Previously, I was using Cloud Functions (Gen1), and I could access App Engine–specific headers such as: X-Appengine-Country X-Appengine-Region X-Appengine-City X-Appengine-Citylatlong

These were very convenient for getting the client’s geo location directly from the request headers.

However, after upgrading my functions to Cloud Run Gen2 (due to Go runtime deprecations), these headers no longer appear in the incoming requests.

Is there any alternative way to get the same geolocation info (country, region, city) without changing my function’s domain or routing all traffic through a Load Balancer?

As far as I know, putting a load balancer in front of the function means changing the domain used to send requests — in other words, previously I could send requests directly to the function’s URL, but after adding a load balancer, I would need to send them to the load balancer’s URL instead. Changing the request domain is not something I want.

1
  • 1
    You will need to do this for yourself without the App Engine geolocation headers. There are 3rd-party services that provide this. NOTE geolocation using IP is imperfect. Commented Oct 10, 2025 at 3:38

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.