GeoIP FirstNonPrivateXForwardedForIP

wandenberg nginx-forum at
Fri Aug 1 02:13:32 UTC 2014


some time ago I had a similar issue and I grab some parts of nginx internals
modules and did one specific to me.
My issue was to use the first XForwardedFor IP, but only when the client
address was the Google Chrome Proxy.
I don't know if this is the best approach,
but I check the client ip using the reverse dns and, if the ip came from
I change it for the first ip on XFowardedFor header. 
Doing that, the GeoIP module can be executed with the "real ip" instead of
the Google.

If you want to look how I did, the code is here
(The idea is to expand this module to support other mobiles proxies like
Windows Phone and Mini Opera.)


Posted at Nginx Forum:,250823,252190#msg-252190

More information about the nginx mailing list