Fastly Global Header Setup
Format:
Header-Sent-To-App: Fastly Source
http.X-Fastly-Country-Code: geoip.country_code
http.X-Fastly-City: geoip.city
http.X-Fastly-Latitude: geoip.latitude
http.X-Fastly-Longitude: geoip.longitude
http.X-Fastly-Region: geoip.region
http.X-Fastly-Country-Name: geoip.country_name
http.X-Fastly-Country-Code-Client: geoip.country_code
However, we only really take into account the X-Fastly-Country-Code
header. While the others can also be added our platform doesn't currently use them for anything, but might in the future.
Install ModHeader (or any other extension for modifying browser headers) https://chrome.google.com/webstore/detail/modheader/idgpnmonknjnojddfkpgkljpfnnfcklj?hl=en
Assuming you're running ModHeader, you can import the following profiles:
Brasília, Brazil
{"title":"Brasília, Brazil","hideComment":true,"headers":[{"enabled":true,"name":"X-Fastly-City","value":"Brasília","comment":""},{"enabled":true,"name":"X-Fastly-Country-Code","value":"BR","comment":""},{"enabled":true,"name":"X-Fastly-Country-Name","value":"Brazil","comment":""},{"enabled":true,"name":"X-Fastly-Latitude","value":"15.794","comment":""},{"enabled":true,"name":"X-Fastly-Longitude","value":"47.833","comment":""},{"enabled":true,"name":"X-Fastly-Region","value":"","comment":""}],"respHeaders":[],"filters":[],"appendMode":""}
Toronto, Canada
{"title":"Toronto, Canada","hideComment":true,"headers":[{"enabled":true,"name":"X-Fastly-City","value":"Toronto","comment":""},{"enabled":true,"name":"X-Fastly-Country-Code","value":"CA","comment":""},{"enabled":true,"name":"X-Fastly-Country-Name","value":"Canada","comment":""},{"enabled":true,"name":"X-Fastly-Latitude","value":"43.653","comment":""},{"enabled":true,"name":"X-Fastly-Longitude","value":"-79.383","comment":""},{"enabled":true,"name":"X-Fastly-Region","value":"","comment":""}],"respHeaders":[],"filters":[],"appendMode":""}
Tokyo, Japan
{"title":"Tokyo, Japan","hideComment":true,"headers":[{"enabled":true,"name":"X-Fastly-City","value":"Tokyo","comment":""},{"enabled":true,"name":"X-Fastly-Country-Code","value":"JP","comment":""},{"enabled":true,"name":"X-Fastly-Country-Name","value":"Japan","comment":""},{"enabled":true,"name":"X-Fastly-Latitude","value":"35.683","comment":""},{"enabled":true,"name":"X-Fastly-Longitude","value":"139.683","comment":""},{"enabled":true,"name":"X-Fastly-Region","value":"","comment":""}],"respHeaders":[],"filters":[],"appendMode":""}
Mexico City, Mexico
{"title":"Mexico City, Mexico","hideComment":true,"headers":[{"enabled":true,"name":"X-Fastly-City","value":"Mexico City","comment":""},{"enabled":true,"name":"X-Fastly-Country-Code","value":"MX","comment":""},{"enabled":true,"name":"X-Fastly-Country-Name","value":"Mexico","comment":""},{"enabled":true,"name":"X-Fastly-Latitude","value":"19.433","comment":""},{"enabled":true,"name":"X-Fastly-Longitude","value":"99.133","comment":""},{"enabled":true,"name":"X-Fastly-Region","value":"","comment":""}],"respHeaders":[],"filters":[],"appendMode":""}
New York, USA
{"title":"New York, USA","hideComment":true,"headers":[{"enabled":true,"name":"X-Fastly-City","value":"New York","comment":""},{"enabled":true,"name":"X-Fastly-Country-Code","value":"US","comment":""},{"enabled":true,"name":"X-Fastly-Country-Name","value":"United States","comment":""},{"enabled":true,"name":"X-Fastly-Latitude","value":"40.739","comment":""},{"enabled":true,"name":"X-Fastly-Longitude","value":"-73.983","comment":""},{"enabled":true,"name":"X-Fastly-Region","value":"NY","comment":""}],"respHeaders":[],"filters":[]}
NOTE: I highly recommend for those using ModHeader to also take advantage of the Profile feature for quickly switching between countries.
If you're not running ModHeader you can manually add the following header to whatever extension you are using, and switch out the value depending on the country you are trying to spoof from (BR
, CA
, JP
, MX
, US
, etc...):
X-Fastly-Country-Code: US
You can refer to this list of official country codes to try spoofing other countries. Keep in mind we specifically use the alpha-2 codes.
Check out the Engineering Blog!
- Building your local Environment
- NFS
-
SSHFS— Deprecated - Troubleshooting
- Environment breaking changes
- Troubleshooting your local
- Bender
- Backend Development
- Conventions
- Solr information
- DoSomething Profile
- Contrib Modules
- DoSomething Modules
- Fender
- Front End Development
- Forge Pattern Library
- Testing
- General information
- Xdebug Guide
- Vagrant
- Disc performance benchmark
- Vagrant and file sharing(SSHFS)
- Documentation
- Memorable pull requests
- Documenting on this Wiki & in Code
- 2016 Product Wiki
- Product information
- Faking your geo location
- For local dev: Fastly header information and configuration
- For everywhere else: VPN Server for Testing International Sites
- Translations
- Making content translatable
- Localization Guidelines
- Old International Setup Resources archive
- Setting up international