Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

GeoIP FirstNonPrivateXForwardedForIP (1 reply)

$
0
0
Hi,

My website does country based redirection based on result obtained from GeoIP against IP.

I am facing a problem where GeoIP does not work as first IP in the X-Forwarded-For has Private network address. (Say 192.168.1.1)

I know GeoIP on private network would fail but the X-Forwarded-For also has the public IP along with Private IP.

Eg : 192.168.1.1, 115.97.213.63 - - [Timezone] ......

In some cases where multiple proxies are involved it would show :

192.168.1.1, 115.97.213.63, 115.97.213.12 - -

I want GeoIP should be done on the first non private ip. I could achieve this in apache using GeoIP module directive called "FirstNonPrivateXForwardedForIP"

How to do this in nginx ?

Kindly suggest

Regards,
Keyur

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>