How to setup MaxMind Mod_GeoIP in Varnish

jean-marc pouchoulon jeanmarc.pouchoulon at
Tue Jan 25 07:46:07 CET 2011

2011/1/25 Roland Rebstock <racemd at>

>  I saw that but I don’t know how to set it to  only allow certain
> countries or block them for that fact… Where do you specify the countries
> you want to allow or block?
> in vcl_recv


          const char* pays = NULL;
          pays = (*get_country_code)(VRT_IP_string(sp,
          VRT_log(sp, pays,  vrt_magic_string_end);

          if(!strcmp(pays, "FR")) {
                VRT_error(sp, 504, "IP not authorized");
                VRT_done(sp, VCL_RET_ERROR);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the varnish-misc mailing list