Forum: NGINX x-forward-header / x-real-ip

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D0a98f6304ff122ac9b487ff8275d8bb?d=identicon&s=25 Payam Chychi (Guest)
on 2009-04-21 21:49
(Received via mailing list)
hey guys,

what is the main difference between these two? reading the
documentation it looks like both set the ip address of the client on
the request which allows you to pass the real client ip address to a
backend server via nginx proxy...  or i could be totally wrong here!

I was looking on the site for an example as to how the config would
look if I wanted to let the backend know of the real client ip address
that is requesting the connection... need this for load balancing.:

Thanks,
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-21 22:37
(Received via mailing list)
On Tue, Apr 21, 2009 at 12:41:16PM -0700, Payam Chychi wrote:

> hey guys,
>
> what is the main difference between these two? reading the
> documentation it looks like both set the ip address of the client on
> the request which allows you to pass the real client ip address to a
> backend server via nginx proxy...  or i could be totally wrong here!
>
> I was looking on the site for an example as to how the config would
> look if I wanted to let the backend know of the real client ip address
> that is requesting the connection... need this for load balancing.:

X-Forwared-For is header where proxy servers usually add client
addresses:
"192.168.1.1, 10.10.10.1, 10.10.1.1". The variable
$proxy_add_x_forwarded_for
does this addition. X-Real-IP is non standard header, where nginx
sets client addresses. Usually you need just one of the them.
D0a98f6304ff122ac9b487ff8275d8bb?d=identicon&s=25 Payam Chychi (Guest)
on 2009-04-21 23:00
(Received via mailing list)
2009/4/21 Igor Sysoev <is@rambler-co.ru>:
>> look if I wanted to let the backend know of the real client ip address
> http://sysoev.ru/en/
>
>


Hey Igor,

Thanks, ok so by just having $proxy_add_x_forwarded_for  active in my
proxy.conf,  this should apply itself for all proxyp_pass connections
sent to the backend correct?
D0a98f6304ff122ac9b487ff8275d8bb?d=identicon&s=25 Payam Chychi (Guest)
on 2009-04-22 09:33
(Received via mailing list)
On Tue, Apr 21, 2009 at 1:51 PM, Payam Chychi <pchychi@gmail.com> wrote:
>>> I was looking on the site for an example as to how the config would
>> Igor Sysoev
>
>
> --
> Payam
>

anyone have anything on this? would greatly be appreciated

thanks,
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-04-22 14:03
(Received via mailing list)
On Tue, Apr 21, 2009 at 01:51:07PM -0700, Payam Chychi wrote:

> >> I was looking on the site for an example as to how the config would
> > Igor Sysoev
> > http://sysoev.ru/en/
> >
> >
>
>
> Hey Igor,
>
> Thanks, ok so by just having $proxy_add_x_forwarded_for  active in my
> proxy.conf,  this should apply itself for all proxyp_pass connections
> sent to the backend correct?

If you use Apache2 as backend, then you should install:
http://stderr.net/apache/rpaf/
This topic is locked and can not be replied to.