Questions tagged [geoip]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
6k views

Unable to locate package Nginx-module-GeoIP

I am working on Debian Jessie 9. I have installed Nginx but there is no GeoIP module. so I decided to install it but "apt-get install nginx-module-geoip" not working giving an error like E: Unable to ...
0 votes
1 answer
1k views

Best way to restrict and block countries on Apache 2.4 (By IP address or Maxmind GeoLite2-Country.mmdb)

I'm looking for a way to block certain countries to access our Apache 2.4 web server running on FreeBSD. We have brute force attacks from time to time, and they often comes from a handfull of ...
0 votes
0 answers
717 views

How to install geoiplookup on CentOS 9 / Rocky 9 / Almalinux 9

geoiplookup is no longer in yum. Supposed replacement mmdblookup is also not available. How to install geoiplookup on CentOS 9 / Rocky 9 / Almalinux 9?
0 votes
1 answer
104 views

Apache geoip not work: PHP Fatal error: Uncaught Error: Undefined constant "HTTP_X_FORWARDED_FOR"

testgeoip.php <html> <head> <title>What is my IP address - determine or retrieve my IP address</title> </head> <body> <?php if (getenv('HTTP_X_FORWARDED_FOR')) { ...
0 votes
1 answer
272 views

xt_geoip not blocking connections?

I have xt_geoip configured to block connections from various countries, but it appears that connections are still being allowed from those countries. From my /etc/iptables/rules.v4 (reduced a little): ...
0 votes
0 answers
47 views

GeoIP-specifing nginx redirect for multiple servers

I need redirection based on country code I get from GeoIP (ngx_http_geoip2_module), but as I see, I can't use map because I need different conditions and destination URLs for different server ...
0 votes
1 answer
2k views

Setting up GeoIP to work with Nginx on Debian 11

I am trying to set up Nginx v. 1.24.0 and GeoIPupdate to work so that users not from a specific country do not get access to the web server. However, as I'm following every guide I see that it is ...
0 votes
0 answers
73 views

What's the recommended way to use GeoIP2 with a varying mirror list?

I want to setup a webserver, where every HTTP request is directly redirected to a nearby mirror. So far we used the unfortunately no longer supported Perl module Apache2::Geo::IP together with Apache'...
0 votes
3 answers
326 views

Unable to Set Custom Error Page 403 for GeoIP

Please need your help. Unable to display the custom error 403 page for geoip restriction. It is always showing default error page 403 Forbidden. Here are my Configurations. /etc/nginx/nginx.conf ...
1 vote
1 answer
3k views

nginx geoip redirect for first time only leads to redirect loop

I'm trying to configure nginx to perform geoIP checks on first-time visitors only. The idea is that first-time visitors should be redirected to the page version which has been customised for their ...
2 votes
1 answer
6k views

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 ...
1 vote
2 answers
1k views

How to use Env in mod_substitute?

Okay, I'm not very strong at htaccess. I have a code: SetEnvIf GEOIP_COUNTRY_CODE US LinkC example1 AddOutputFilterByType SUBSTITUTE text/html Substitute s/example2/env=LinkC/ni I'm trying to ...
1 vote
0 answers
423 views

Debian 11 - Crowdsec - geoip-enrich ignored

I installed crowdsec on a Debian 11 (and 12) machine and it works but the geoip localization. If I do: # cscli collections list INFO[19-09-2021 10:16:20 AM] Ignoring file /etc/crowdsec/parsers/...
2 votes
1 answer
4k views

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 ...
0 votes
2 answers
15k views

How should I add GeoIP module to nginx?

I'm using nginx version 1.8 on a centos 6.7 server but when using nginx -V command , I can't see geoip_module there . How can I add it to nginx ?
0 votes
1 answer
985 views

nginx TCP forwarding with GeoIP

CentOS 7.8 nginx version: nginx/1.18.0 yum install nginx-module-geoip yum install GeoIP GeoIP-data Then, GeoIO runs well with HTTP(S). I need nginx to forward a TCP port, which is only open to CN add ...
0 votes
0 answers
385 views

Nginx: implementing country block with a map

I am trying to implement, on a nginx webserver, a country block with a map. This is my server configuration: include snippets/ban-country-codes.conf; include snippets/ban-user-agent.conf; server { ...
1 vote
2 answers
1k views

How often do country IP address ranges change?

How often do country IP address ranges change? I get a lot of notifications about failed login via Wordpress or SSH. It's very hard to ban every single IP address, so I wrote a script to block single ...
0 votes
1 answer
197 views

Does CDN defeat the purpose of server-level GeoIP blocking?

Looking for second opinions. Suppose a website is set up so that only IPs from country X are allowed read/write access. This server goes through a CDN such as Cloudflare. Because the GeoIP block is at ...
1 vote
1 answer
416 views

bind9 geoip does not function correctly

bind9 bind-9.17.2 has been compiled from source on debian-9. ./named -V BIND 9.17.2 (Development Release) <id:6d46544> running on Linux x86_64 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-...
1 vote
0 answers
2k views

How to troubleshoot GeoIP error: error opening file /usr/share/GeoIP/GeoIP.mmdb

I am new to the GeoIP solution. Some things have changed regarding legacy GeoIP dbs which has made it seem a little more complicated. I am on AWS Linux I have installed GeoIP: rpm -qa |grep GeoIP ...
1 vote
1 answer
2k views

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 /<country_zone>/<actual_url>/* . I am able to retrive $country_zone value which can be any of (in|uk|us|...
0 votes
1 answer
1k views

Iptables is not matching the chain with xtables-addons GeoIP

I have a strange issue with xtables-addons, in particular with xt_geoip module. I'm using Ubuntu 18.04.3 LTS x64 4.15.0-1051 with all the packages updated, I installed the following packages: ...
1 vote
1 answer
3k views

How to add ngx_http_geoip2_module support to Nginx [closed]

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.
1 vote
3 answers
5k views

nginx GEOIP behind cloudflare proxy showing wrong country (not of end user, but if proxy)

I am using Cloudflare and nginx geoip directives: geoip_country /usr/local/share/GeoIP/GeoIP.dat; geoip_city /usr/local/share/GeoIP/GeoLiteCity.dat; They are picking the IP up OK (as pipaddress ...
0 votes
0 answers
416 views

nginx: Block specific PHP file from most countries

Background: I run several WordPress sites and I notice a huge amount of distributed brute force login attempts. fail2ban does not help me here because the attacker carefully attempts only up to 5 ...
3 votes
1 answer
2k views

Installing GeoIP on Amazon EC2 Linux

I am trying to install GeoIP module to block country specific traffic to my website. My Website is LAMP configured and hosted on Amazon AWS EC2 instance. As per some article on google, I followed ...
1 vote
1 answer
3k views

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,...
6 votes
3 answers
18k views

unknown directive "geoip_country" on nginx/1.10.1

I have a nginx/1.10.1 on my CentOS 7 installed via nginx repo. I just install geoip module [root@www nginx]# nginx -V nginx version: nginx/1.10.1 built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC) ...
4 votes
4 answers
5k views

Nginx and GeoLite2 not working

Is Nginx official ngx_mod_http_geoip compatible with GeoLite2 databases ? I can't get them working, so I assume they are not compatible ?
4 votes
2 answers
9k views

Nginx geoipblocking & allowing LAN IPs

I'd like to block IPs with geoip except whitelisted countries AND the local area network. The first part works flawless, the second one not. Somwehere searching the internet I found the codes LH (...
0 votes
1 answer
299 views

GeoIP Split DNS Wrong 3rd View on Slave

Successfully configured Bind to host multiple views with TSIG with this guide. Problem is when I add a third view to the mix, things get weird. On each server, I have 3 views right now: USA Europe ...
3 votes
0 answers
2k views

GeoIP vs IPset performance in iptables

I would like to ask you what is faster in term of performance GeoIP or IPset. Let me explain, imagine that I have rule: iptables -A INPUT -m geoip ! --src-cc US,UK,CA -j DROP And imagine that I ...
0 votes
1 answer
3k views

GeoIP Apache Mod Whitelist by Country and Local Network

I've been having issues with attempted hackers trying to break into my web server so I decided to block traffic from everywhere except my target countries: US, France, and Germany. I installed the ...
0 votes
1 answer
2k views

Is there any limitations in using GeoIP with bind9

I have a DNS server (BIND 9.10.3-P4-Ubuntu) on an Ubuntu 16.04 machine. I have a domain with two A records (IP1,IP2) which indicates to two separate web servers (Wserver1, Wserver2). I want the DNS ...
0 votes
1 answer
191 views

Why GCP Kubernetes Node host location for europe-north1 seems to be in US?

I am new to both Google Cloud Platform and K8s. I have launched Kubernetes cluster in GCP and chosen europe-north1 as the region (europe-north1-a as the zone). When I try to run my application on ...
2 votes
1 answer
5k views

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 ...
2 votes
1 answer
5k views

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:...
0 votes
1 answer
505 views

NGINX, GeoIP, Varnish : Too many Redirects

I own two servers. One in Singapore (data.example.me) and other one in Europe (eu.data.example.me). I want the website to serve the users from their closest server when they visit my website. I ...
0 votes
1 answer
2k views

What this is parameter in the geo block in Nginx?

In nginx, in geo module it has the following example http://nginx.org/en/docs/http/ngx_http_geo_module.html I am wondering what is this 0,2,1,1 numbers etc.. stated after the main addresses (values). ...
1 vote
0 answers
847 views

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] "...
0 votes
1 answer
5k views

GEOIP for IIS 10

I'm migrating from Apache 2.4 back to IIS 10. IIS does have a IP restriction interface but there is noway to GEO ban by country. Is there a similar module than Apache Maxmind Geo IP module for IIS? ...
8 votes
2 answers
25k views

Installing GeoIP on CentOS

On CentOS 6 I cannot install GeoIP even though many websites describe installing GeoIP with the following commands: yum install GeoIP GeoIP-devel GeoIP-data I get No package GeoIP available.
1 vote
1 answer
3k views

Nginx proxy_set_header not working to Apache GEOIP

I'm using Nginx reverse proxy to apache2 using following tutorial. Then i try to install geoip to Nginx using this tutorial The reverse proxy works flawlessly for a while now, until I tried to ...
4 votes
3 answers
5k views

Geo-blocking in Azure

Is there any functionality available in azure out of the box to block access to a website or server from specific countries? In a larger project that I'm involved with, we have an Imperva WAF and ...
2 votes
1 answer
2k views

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(...
23 votes
9 answers
44k views

Relatively easy way to block all traffic from a specific country?

I have a web app that has no users in the Philippines, but is constantly bombarded by spammers, carders testing cards, and other undesirable activity from there. I can see in the logs that they have ...
12 votes
2 answers
18k views

GeoIP for configuration into nginx

I'm trying to compile geoip into nginx. When doing ./configure --with-http_geoip_module I get the following error. ./configure: error: the GeoIP module requires the GeoIP library. You can either do ...
2 votes
0 answers
4k views

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 ...
3 votes
0 answers
3k views

Apache 2.4, mod_geoip GeoIPScanProxyHeaders "On" not working

apache httpd.conf LoadModule geoip_module modules/mod_geoip.so <IfModule mod_geoip.c> GeoIPEnable On GeoIPEnableUTF8 On GeoIPOutput Env GeoIPScanProxyHeaders On GeoIPDBFile /...