Using GeoIP Functionality in Varnish

Sebastian Cabrera scabrera-varnish at portachtzig.de
Tue Mar 16 17:22:53 CET 2010


Hi everybody,

On a Website i want to have the posibility to do some rewriting due to
the Country he's comming from. So if someone visits the Mainpage
(domain.com) from US i want to have him visiting domain.com/us/.
Does anyone have any experiences with that? How can i do this?
I just downloaded and installed the GeoIP Plugin from the varnish wiki
(http://varnish-cache.org/wiki/GeoipUsingInlineC), but how can i use it?
Is there any possibility to do something like

if (get_country_code(client.ip) == "US") {
    set req.url = "/us/"
}

?

thanks for your help,
regards,

Sebastian




More information about the varnish-misc mailing list