Igor Sysoev
November 23, 2009 03:52AM
On Mon, Nov 23, 2009 at 03:19:08AM -0500, himesh wrote:

> Hi guys,
>
> Iam trying to set up geoip functionality on nginx, I believe it works only with Nginx 0.8 not earlier.

geoip module is in 0.7 since 0.7.63.
Also, there is another geo module in all modern versions.

> I was using GeoIP with Apache to allow access to Only US IPs with the following config...
>
> SetEnvIf GEOIP_COUNTRY_CODE US AllowCountry
>
>
> Deny from all
> Allow from env=AllowCountry
>
>
>
> How can i achieve the same on Nginx.

server {

if ($geoip_country_code != US) {
return 403;
}

...

Also, you may see this thread:
http://nginx.org/pipermail/nginx/2009-August/014705.html


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

GeoIP On Nginx

himesh November 23, 2009 03:19AM

Re: GeoIP On Nginx

Igor Sysoev November 23, 2009 03:52AM

Re: GeoIP On Nginx

himesh November 23, 2009 05:16AM

Re: GeoIP On Nginx

Igor Sysoev November 23, 2009 05:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 163
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready