GeoIP Legacy not picking up country

#1
Hi

Ive been setting up GeoIP. But OSL does not find any country in the GeoIP database.

Testing the geofile is working correct
geoiplookup /usr/share/GeoIP/GeoIP.dat x.x.x.x
GeoIP Country Edition: DK, Denmark


My test rules, consist of wp block from wiki/documentation:

RewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^(GB|DK|US|IN)$
RewriteRule (wp-login|xmlrpc).php$ - [F,L]


I have setup behind proxy, therefore:
Use Client IP in Header Trusted IP Only
And this is tested and working, access log shows correct client IP.

But in error.log for the REWRITE output i get the following

2021-04-11 19:57:44.239276 [INFO] [121759] [10.10.10.24:38310#site.com] [REWRITE] Rule: Match '/wp-login.php' with pattern '(wp-login|xmlrpc).php$', result: 2
2021-04-11 19:57:44.239296 [INFO] [121759] [10.10.10.24:38310#site.com] [REWRITE] Cond: Match '' with pattern '^(GB|DK|US|IN)$', result: -1


Therefore no country is working: Cond: Match ''

I am noticing that the log output shows IP 10.10.10.24 - this is the IP of the load balancer, not the browser client.
Could this be?


Attached is a screenshot of my geoip configuration.

Is this a bug - or did i just misconfigure the setup?

Any help appreciated
 

Attachments

#4
Hello,
i switched to mmdb format and it worked.
Apparenty, also there was some changes in the syntax to be used for this, and since i do not use the lsws GUI (in directadmin by default you can not) it was a bit harder to tell wich one was the right one among the variants i found.

But i confirm it works.
 
#5
i switched to mmdb format and it worked.
Apparenty, also there was some changes in the syntax to be used for this, and since i do not use the lsws GUI (in directadmin by default you can not) it was a bit harder to tell wich one was the right one among the variants i found.
Hi, are there simple instructions anywhere to follow to set up the mmdb format? The OLS knowledge base has instructions for the old dat format -> https://openlitespeed.org/kb/geolocation-setup/
Any help welcome!
 
Top