Hello!

I used to add these lines to my haproxy config:
    reqidel ^Client-IP:.*
    reqidel ^X-Forwarded-For:.*
    option http-server-close
    option forwardfor
and it worked.

First two lines remove headers Client-IP and X-Forwarded-For passed by
a user (not to confuse Wt webserver), 4-th line sets  real IP to
X-Forwarded-For header. I dunno what http-server-close is needed for,
maybe it is unrelated here.

Nowdays I use nginx with following config line:
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Client-IP "";

Client-IP is set to empty string to prevent Wt confusion in case user
passes smth in Client-IP.

-
Best regards,
Boris Nagaev


On Sun, Jul 20, 2014 at 2:04 AM, Jeffrey Scott Flesher Gmail
<jeffrey.scott.fles...@gmail.com> wrote:
> Nagaev Boris mentioned using a Gather Class which uses flash
> http://starius.ru/wt-classes/reference/classWt_1_1Wc_1_1Gather.html#_details
> All I need is the users IP address, and I do not want to use flash, since it
> may not be loaded on the users system, I do not have it loaded, and I am
> sure a lot of others do not like it as well.
>
> This is only returning the servers IP address
>
> app->environment().clientAddress()
>
> Reading this:
> Returns the IP address of the client.
> The (most likely) IP address of the client that is connected to this
> session.
> This is taken to be the first public address that is given in the Client-IP
> header,
> or in the X-Forwarded-For header (in case the client is behind a proxy).
> If none of these headers is present, the remote socket IP address is used.
>
> I got the idea that its something I need to change in my haproxy config, but
> not sure what:
> I have this set:
> option forwardfor
>
> and played with these settings also:
> option httpclose
> option  http-server-close
> even
> option forceclose
>
> I even tried reqidel ^X-Forwarded-For: after reading a post:
> http://serverfault.com/questions/437088/haproxy-not-properly-passing-on-x-forwarded-for-header
> and reqidel ^X-Forwarded-For:.* after reading:
> http://serverfault.com/questions/358939/overriding-the-x-forwarded-for-header-in-haproxy
> It didn't help.
>
> Can anyone tell me if this is an haproxy issue or is there another way to
> get the users IP address?
>
> Thanks
> Jeff Flesher
>
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to