Created
July 9, 2015 23:21
-
-
Save section-io-gists/9ae493902ca947087ca6 to your computer and use it in GitHub Desktop.
This file contains 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
#section.io VCL sample. Copy paste into your section.io account to implement instantly | |
#This code example requires you to use a Varnish version that has the GEO IP vmod installed | |
#Import vmod to do geoip on requests | |
import geoip; | |
#vcl_recv - copy this code into the section called sub vcl_recv | |
set req.http.X-Country-Code = geoip.country_code(regsub(req.http.X-Forwarded-For, ",.*","")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment