Welcome! Log In Create A New Profile

Advanced

Re: http headers ip address

April 21, 2009 06:44AM
On Sun, Apr 19, 2009 at 01:43:45PM -0700, rkmr.em@gmail.com wrote:

> Hi Michael,
> Thanks a lot for this.
>
> I want to do this only if this header is available. IF it is not available,
> it should the client ip should be the default one.
> how can i do that?

If the header is not available client address is not changed.

> thanks again
>
> On Sun, Apr 19, 2009 at 9:48 AM, Michael Shadle <mike503@gmail.com> wrote:
>
> > make sure nginx has the "realip" module (nginx -V, look for
> > --with-http_realip_module) - you could try it and run nginx -t to
> > check the conf file to see if it's in your compile too.
> >
> > Double check the header isn't a different case like
> > X-FB-User-Remote-Addr or something (if you saw this in PHP it would be
> > capitalized, but also prefixed with SERVER so maybe it is always
> > capped)
> >
> > Lastly this is all you need. The first line is if you want to only
> > trust that header from another proxy / load balancer / etc, which you
> > probably do, so you can set it to the appropriate netmask.
> >
> > set_real_ip_from 0.0.0.0/0;
> > real_ip_header X-FB-USER-REMOTE-ADDR;
> >
> >
> >
> > On Sun, Apr 19, 2009 at 9:16 AM, rkmr.em@gmail.com <rkmr.em@gmail.com>
> > wrote:
> > > hi
> > > i get the clients ip address in this http header: X-FB-USER-REMOTE-ADDR.
> > how
> > > do i configure nginx so that this is set as the ip address of client for
> > a
> > > fastcgi app?
> > >
> > > thanks a lot!
> > >
> > >
> >
> >

--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

http headers ip address

rkmr.em@gmail.com April 19, 2009 12:16PM

Re: http headers ip address

mike April 19, 2009 12:48PM

Re: http headers ip address

rkmr.em@gmail.com April 19, 2009 04:43PM

Re: http headers ip address

Igor Sysoev April 21, 2009 06:44AM

Re: http headers ip address

Igor Sysoev April 21, 2009 06:43AM

Re: http headers ip address

mike April 21, 2009 11:30AM

Re: http headers ip address

Igor Sysoev April 21, 2009 06:41AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 236
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready