Spoof IP for geoip plugin?

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.

On Mon, Sep 13, 2010 at 09:34:26AM +0100, Phillip O. 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 S.
http://sysoev.ru/en/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs