Skip to content

Instantly share code, notes, and snippets.

@section-io-gists
Created July 9, 2015 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save section-io-gists/9ae493902ca947087ca6 to your computer and use it in GitHub Desktop.
Save section-io-gists/9ae493902ca947087ca6 to your computer and use it in GitHub Desktop.
#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