Questions tagged [geoip]
84 questions
2
votes
1 answer
GEOIP redirect with https
server{
listen 80;
listen [::]:80;
server_name 111.111.111.111 example.com www.example.com;
return 301 https://example.com$request_uri;
}
I have not installed any extra NGINX libraries. I have the above server block in my…

kabuto178
- 121
- 1
- 3
2
votes
1 answer
GeoIP: Redirect all but specific countries
I am using Apache's GeoIP module and a MaxMind database to determine the country of a visitor based on their IP address and redirecting them to a country sub-folder as shown below:
RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^US$
RewriteRule ^(.*)$…

Ralph
- 862
- 11
- 26
2
votes
1 answer
GeoIP PHP extension not working on CentOS 7
I can't get the GeoIP PHP extension working on CentOS 7 and PHP 5.5.21.
I first started with yum install php-pecl-geoip and restarted httpd. I then did a simple test:
$record = geoip_record_by_name($_SERVER["REMOTE_ADDR"]);
if ($record) {
…

Pat
- 274
- 3
- 14
2
votes
0 answers
Nginx: How to determine if a module is installed
Im using nginx as load balancer in a dockerized setup.
Im trying to get the http_geoip_module up and running so I can redirect traffic based on users geographical position.
Question:
The command nginx -V outputs…

Vingtoft
- 1,547
- 3
- 15
- 17
2
votes
1 answer
MaxMind GeoIP CSV to .dat
I need to put local IP addresses into MaxMind GeoIP DB.
I've downloaded the CSV and adding new IP addresses and locations is easy.
I've found two tools that do csv to dat for MaxMind GeoIP but I can't get them work.
With python script:
./csv2dat.py…

yax
- 31
- 1
- 4
2
votes
1 answer
open source geolocation aware authoritative DNS server with edns-client-subnet support
geoip-enabled authoritative dns server is quite easy to find - bind9 with patch can do it, powerdns as well. but the problem starts when server receives DNS query from global public resolvers like google's 8.8.8.8. the request might come from ip in…

pQd
- 29,981
- 6
- 66
- 109
2
votes
1 answer
Geo fencing, ip address list of different geographies
I need to provide different webpage experiences based on geographies divided as Western, Asian, African audience etc.
I plan to do this with Nginx geo module by segmenting ip addresses and routing to the webserver with headers set from the Nginx…

Quintin Par
- 4,373
- 11
- 49
- 72
2
votes
0 answers
php5-geoip performance issue
I installed the php5-geoip module on Ubuntu 10.04 via apt-get install php5-geoip. I've updated the geocities.dat library
The production server performance decreased and load average is soaring. Before the install it was less than 1 for the same…

Niro
- 1,401
- 4
- 20
- 36
2
votes
3 answers
GeoIP based greylisting with Exim?
I have been using Sendmail together with milter-greylist for many years at several sites.
milter-greylist has support for defining greylisting rules based on GeoIP database lookups. This is very convenient for companies who do not do business…

snap
- 1,251
- 10
- 18
2
votes
3 answers
Nginx HttpGeoIPModule with X_Forwarded and HAProxy
Is it possible to make Nginx HttpGeoIPModule use the X_Forwarded IP that is sent via HAProxy? It is currently just using the incorrect server IP, but unsure how I can make Nginx use the X_Forwarded IP.
Any ideas?

James
- 171
- 1
- 3
- 15
2
votes
1 answer
How can I install the ngx_http_geoip2_module module ? on Centos
I installed the GeoIP package using yum. I got the geoIP files in the /usr/share/GeoIP/ folder. I need to add some rules on some countries in the: /etc/nginx/nginx.conf and to do that i need to load the module, like: load_module…

Attila Naghi
- 121
- 1
- 4
1
vote
1 answer
Nginx : How to do dynamic path routing requests to single root directory with different country (geoip module)
How to do dynamic path routing requests to single root directory and url to ///* .
I am able to retrive $country_zone value which can be any of (in|uk|us|other) using geoip module.
e.g
Request => Response
/ => /
/ (with…

sushil kanojia
- 11
- 2
1
vote
1 answer
How to add ngx_http_geoip2_module support to Nginx
geoip is one of the must-have module for Nginx, in the latest Nginx package i couldn't find geoip2 support. It is showing a few dependency errors.

Shameem
- 21
- 3
1
vote
1 answer
Cannot set GeoIP rules in iptables
I try to add this rule:
iptables -A INPUT -m geoip ! --src-cc CZ,SK -j DROP
I set GeoIP support according to this answer: Ubuntu IPTables allow only allow 1 country | Super User
But it doesn't work, because I get message: iptables: No…

tomsk
- 287
- 1
- 6
- 18
1
vote
0 answers
Nginx 301 redirect of bad requests
I've found those requests in my access.log of nginx:
X.X.X.X - - [03/Apr/2017:20:52:31 +0200] "GET //phpMyAdmin/scripts/setup.php HTTP/1.1" 301 184 "-" "-"
X.X.X.X - - [03/Apr/2017:20:52:31 +0200] "GET //myadmin/scripts/setup.php HTTP/1.1" 301 184…

PatrickMA
- 113
- 6