client.geo.ip_override

STRING, can be read and set, but not unset.

Available in all subroutines.

Override the IP address for geolocation data. The default is to use geolocation data for client.ip.

It is possible to set client.geo.ip_override to an invalid IP address

set client.geo.ip_override = "xxx";

in which case the various geolocation variables present values to indicate an invalid region. STRING variables are set to the empty string, FLOAT variables are set to 999.0, and INTEGER variables are set to 0.

Try it out

client.geo.ip_override is used in the following solution recipes, which show real world use cases. Click RUN to provision a Fastly service, execute the code on Fastly, and see how the function behaves.

Geo-IP API at the edge

Create an API endpoint for fetching GeoIP data for the requesting browser, implemented 100% at the edge. The response should show your current approximate location, but no requests to any origin servers.

Comprehensive logging

Fastly offers a myriad of different variables that you can log. See and test a large collection here.

User contributed notes

We welcome comments that add use cases, ideas, tips, and caveats. All comments will be moderated before publication. To post support questions, visit our support center and we'll find you the help you need.