Last active
August 7, 2018 09:33
-
-
Save mshmsh5000/3efff21a83dabfa6a54a35850c6bd222 to your computer and use it in GitHub Desktop.
Fastly GeoIP header injection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Request headers | |
sub vcl_recv { | |
set req.http.X-Fastly-Country-Code = geoip.country_code; | |
set req.http.X-Fastly-Country-Name = geoip.country_name; | |
set req.http.X-Fastly-City = geoip.city; | |
set req.http.X-Fastly-Latitude = geoip.latitude; | |
set req.http.X-Fastly-Longitude = geoip.longitude; | |
set req.http.X-Fastly-Region = geoip.region; | |
#FASTLY recv | |
} | |
# Response headers | |
sub vcl_deliver { | |
set resp.http.X-Fastly-Country-Code = geoip.country_code; | |
set resp.http.X-Fastly-Latitude = geoip.latitude; | |
set resp.http.X-Fastly-Longitude = geoip.longitude; | |
#FASTLY deliver | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment