Spoof IP for geoip plugin?

Igor Sysoev igor at sysoev.ru
Mon Sep 13 12:38:19 MSD 2010


On Mon, Sep 13, 2010 at 09:34:26AM +0100, Phillip Oldham wrote:

>   Is there a way I can spoof my local IP when testing nginx's geoip 
> plugin? I'm running a VM which has a static IP on my local network which 
> runs a development version of my app sitting behind nginx. I need to 
> test that the right geoip headers are being passed to my app, but since 
> I'm on a local network my ip isn't set in the geoip.dat file.

You shoul built nginx --with-http_realip_module, then add trusted client
address in the confguration:

     set_real_ip_from  127.0.0.1;

and make requests with the header line:

X-Real-IP: 1.1.1.1


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



More information about the nginx mailing list