You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we've used this great VMOD for some time on Varnish3 without issue. Building a new server from scratch with Varnish4 (centOS based) and have built the GeoIP VMOD ok...
# ls -al /usr/lib64/varnish/vmods/
total 336
drwxr-xr-x 2 root root 4096 Dec 7 12:13 .
drwxr-xr-x 3 root root 4096 Dec 2 12:25 ..
-rwxr-xr-x 1 root root 120206 Dec 1 10:53 libvmod_directors.so
-rw-r--r-- 1 root root 61260 Dec 7 12:13 libvmod_geoip.a
-rwxr-xr-x 1 root root 971 Dec 7 12:13 libvmod_geoip.la
-rwxr-xr-x 1 root root 41337 Dec 7 12:13 libvmod_geoip.so
-rwxr-xr-x 1 root root 99764 Dec 1 10:53 libvmod_std.so
Have the following in the VCL...
import geoip;
sub vcl_recv
{
set req.http.X-Forwarded-For = client.ip;
set req.http.X-GeoIP = geoip.country_code(req.http.X-Forwarded-For);
...
However always getting "AA" for the country code - which the README explains is an error (have also tried the country & contry_code_from_ip equivelant methods). Ive checked that the IP is req.http.X-Forwarded-For is accurately reflecting user's IP. We have the Geoip package installed and the MaxMind .dat files are in place...
I debug for a couple of hours varnish, varnishd is not loading any GeoIP database file, so I think the init method is never called. I deploy your recomentadion @SpoddyCoder, it works perfectly.
Hi,
we've used this great VMOD for some time on Varnish3 without issue. Building a new server from scratch with Varnish4 (centOS based) and have built the GeoIP VMOD ok...
Have the following in the VCL...
However always getting "AA" for the country code - which the README explains is an error (have also tried the country & contry_code_from_ip equivelant methods). Ive checked that the IP is req.http.X-Forwarded-For is accurately reflecting user's IP. We have the Geoip package installed and the MaxMind .dat files are in place...
Any help or guidance on what/where to check next would be greatly appreciated!
Many thanks,
Paul
The text was updated successfully, but these errors were encountered: