Skip to main content

Questions tagged [geoip]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
2k 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 ...
Aknot's user avatar
  • 195
0 votes
0 answers
921 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?
Nick's user avatar
  • 882
0 votes
1 answer
123 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')) { ...
dr.ipkins's user avatar
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 ...
Tomulis's user avatar
0 votes
0 answers
76 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'...
Erich's user avatar
  • 111
0 votes
3 answers
346 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 ...
Muhammad Usman's user avatar
0 votes
1 answer
283 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): ...
r2evans's user avatar
  • 125
1 vote
0 answers
443 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/...
Matteo's user avatar
  • 41
0 votes
1 answer
1k 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 ...
qq77273364's user avatar
0 votes
0 answers
406 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 { ...
Sandro B.'s user avatar
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 ...
user3646958's user avatar
0 votes
1 answer
206 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 ...
cvlo's user avatar
  • 1
1 vote
1 answer
423 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-...
Shakiba Moshiri's user avatar
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 ...
Attila Naghi's user avatar
1 vote
0 answers
3k 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 ...
user203106's user avatar
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|...
sushil kanojia's user avatar
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: ...
Skonvols2k's user avatar
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.
Shameem's user avatar
  • 21
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 ...
JohnGraphy's user avatar
0 votes
0 answers
431 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 ...
jlh's user avatar
  • 181
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 ...
Vinay Ahlawat's user avatar
0 votes
1 answer
307 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 ...
emdk's user avatar
  • 3
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 ...
tomsk's user avatar
  • 297
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 ...
Nick Schiwy's user avatar
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 ...
Sinai's user avatar
  • 213
0 votes
1 answer
196 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 ...
Umeetiusbaarus's user avatar
2 votes
1 answer
6k 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 ...
kabuto178's user avatar
  • 121
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,...
tomsk's user avatar
  • 297
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:...
Ralph's user avatar
  • 902
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 ...
Vineeth Penugonda's user avatar
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 ?
user3448600's user avatar
  • 1,629
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). ...
Don Dilanga's user avatar
1 vote
0 answers
854 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] "...
PatrickMA's user avatar
  • 113
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? ...
Eric's user avatar
  • 81
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 ...
Someone Special's user avatar
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 ...
Don Pratt's user avatar
  • 141
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(...
Pat's user avatar
  • 284
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 ...
cooher's user avatar
  • 21
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) ...
azatuni's user avatar
  • 93
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 ...
Vingtoft's user avatar
  • 1,597
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 ...
yax's user avatar
  • 31
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 /...
ar099968's user avatar
  • 505
0 votes
2 answers
1k views

"Nmap Scripting Engine" HTTP Requests

I looked into my nginx access logs to check who accessed my server and I noticed this line: <IP> - - [25/Feb/2016:02:49:12 +0100] "GET / HTTP/1.1" 302 160 "-" "Mozilla/5.0 (compatible; Nmap ...
PatrickMA's user avatar
  • 113
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 ...
morleyc's user avatar
  • 1,130
0 votes
1 answer
1k views

How to test GeoIP .dat librairie in local

I'm on a projet where I have to implement GeoIP on a Redhat Apache instance. For now, i'm only testing the configuration in local. Here it is : <IfModule mod_geoip.c> GeoIPEnable On ...
Ismail H's user avatar
  • 107
1 vote
0 answers
558 views

NginX with GeoIP - what is returned for geo code when no mapping is found?

As the tests I conducted (using Java API to read GeoIP.dat, as well as local test) might be insufficient, I was wondering what happens on NginX when geo-ip module is configured, and when no IP to ...
Less's user avatar
  • 121
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 ?
movi ran's user avatar
0 votes
0 answers
680 views

GeoIP module (mod_geoip2) and Amazon EC2 Ubuntu instance

I have installed GeoIP mod via http://dev.maxmind.com/geoip/legacy/mod_geoip2/ and have made sure the permissions are correct for www-data to read the database. We are just needing to block a ...
Whsperz's user avatar
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 ...
cortopy's user avatar
  • 383
0 votes
1 answer
248 views

Varnish GeoIP (vmod_geoip) + Amazon Linux

I'm trying to install vmod_geoip via amazon linux, but so far no luck. I've installed geoip geoip-devel. I've downloaded the vmod_geoip source. I'm able to ./autogen.sh but ./configure constantly ...
Michael Mikhjian's user avatar