Geolocation VCL features
Fastly exposes a number of geographic variables for you to take advantage of inside VCL for both IPv4 and IPv6 client IPs.
NOTE: While Fastly exposes these geographic variables, we cannot guarantee their accuracy. The variables are based on available geographic data and are intended to provide an approximate location of where requests might be coming from, rather than an exact location. The postal code associated with an IP address is the most granular level of geographic data available.
NOTE: Geolocation information, including data streamed by our log streaming service, is intended to be used only in connection with your use of Fastly services. Use of geolocation data for other purposes may require the permission of a IP geolocation dataset vendor, such as Digital Element.
TIP: If you're updating your configurations from older version of the geolocation variables, be sure to read our migration guide.
Using geographic variables with shielding
If you have shielding enabled, you should set the following variable before using geographic variables:
set client.geo.ip_override = req.http.Fastly-Client-IP;