# Geo Module. How to make nginx to check proxy for any ip?

**URL:** <https://www.ruby-forum.com/t/geo-module-how-to-make-nginx-to-check-proxy-for-any-ip/227432>\
**Category:** NGINX\
**Created:** [March 15, 2013, 9:24am UTC](https://www.ruby-forum.com/t/geo-module-how-to-make-nginx-to-check-proxy-for-any-ip/227432 "2013-03-15T09:24:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![varan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/43a26b/32.png) [@varan](https://www.ruby-forum.com/u/varan)\
**Post date:** [March 15, 2013, 9:24am UTC](https://www.ruby-forum.com/t/geo-module-how-to-make-nginx-to-check-proxy-for-any-ip/227432/1 "2013-03-15T09:24:31Z")

</div>

I mean I haven’t got full list of ip addresses that can be proxy, so I  
want  
nginx to look X-FORWARDED-FOR header for any ip address, and if the  
header  
exists to determine geo using the header. If there’s no X-Forwarded-For  
header, then use ip address for geo.  
is it acceptable to use “proxy 0.0.0.0/0” ?

for example:

geo $geo {  
default ZZ;  
proxy 0.0.0.0/0;

```
127.0.0.1/32 RU;
192.168.0.1/32 UK;
...

```

}

Posted at Nginx Forum:

> **[Geo Module. How to make nginx to check proxy for any ip?](https://forum.nginx.org/read.php?2,237392,237392#msg-237392)**
>
> I mean I haven't got full list of ip addresses that can be proxy, so I want nginx to look X-FORWARDED-FOR header for any ip address, and if the header exists to determine geo using the header. If there's no X-Forwarded-For header, then use ip address...

---

<div class="post-metadata">

**Author:** ![varan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/43a26b/32.png) [@varan](https://www.ruby-forum.com/u/varan)\
**Post date:** [March 15, 2013, 11:03am UTC](https://www.ruby-forum.com/t/geo-module-how-to-make-nginx-to-check-proxy-for-any-ip/227432/2 "2013-03-15T11:03:17Z")

</div>

Hello!

On Fri, Mar 15, 2013 at 04:24:13AM -0400, varan wrote:

> ```
> proxy 0.0.0.0/0;
> 
> 127.0.0.1/32 RU;
> 192.168.0.1/32 UK;
> ...
> 
> ```
> 
> }

This will work, but it means that anybody will be able to easily  
fool your geo detection.

–  
Maxim D.

> **[nginx: donation](http://nginx.org/en/donation.html)**
