2011/1/25 Roland Rebstock <[email protected]>

>  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

    C{

          const char* pays = NULL;
          pays = (*get_country_code)(VRT_IP_string(sp,
VRT_r_client_ip(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);
          }
    }C
hth
_______________________________________________
varnish-misc mailing list
[email protected]
http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to