G
G
Gibbzy2011-04-09 14:41:34
Geolocation
Gibbzy, 2011-04-09 14:41:34

Blocking users on the site by location?

Hi all.
I was given the following task:
It is necessary that there is no access to the site from one specific country.
For example from India.
You can block by ip mask, but this is somehow not ice.
You can add geolocation.
Who else has ideas?

Answer the question

In order to leave comments, you need to log in

8 answer(s)
V
Vitaly Peretyatko, 2011-04-10
@viperet

I’ll tell you using nginx as an example, in any case, if you don’t use it yet, it’s time to start)
there is a ngx_http_geo_module module, ext is enabled by default (not to be confused with ngx_http_geoip_module). This module can check the visitor's IP with masks and assign the country code to the variable. For its operation, you need a free GeoIP City Free database, it is downloaded from the maxmind site in csv format and the perl script that comes with the nginx sources is converted to the nginx config format - say geo.conf
Add to the config:
geo $country {
include geo.conf;
}
if ($country = "cn") {
return 403;
}
this example denies access from china

R
rasa, 2011-04-09
@rasa

FSB of India detected!

L
lasthero, 2011-04-09
@lasthero

I used geoip on the site. And I gave different countries a site in the right language + additional features.

S
serverside, 2011-04-09
@serverside

What does "no ice" mean? There are only three options, and blocking by ip is the most accurate.
You can also use the name of the first level domain (deny from .in) or the language in the browser. But this is just not ice at all. Surely in India, all providers on .com and .net sit, and the language of most is English.
And, well, you can still ask the visitor: “And you, for an hour, will you not be from India?” :)

G
greengarlic, 2011-04-09
@greengarlic

I guess there are no other ways

V
Vlad Zhivotnev, 2011-04-09
@inkvizitor68sl

Drive their ranges into ipfw.

U
uadeveloper, 2011-04-09
@uadeveloper

www.maxmind.com/ - database by ip.
Yes, and Google will help you with the request geoip

A
Anton Anikin, 2011-04-09
@ColorPrint

Geo IP module.
Both Apache and nginx have it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question