I have a problem with HAproxy.
I use HAproxy as load balancer which distribute incoming http requests to 5 web servers. normally a client request's is forwarded to web servers with loadbalancer's IP. But I need clients IPs or real IPs who request something from web servers. Because we need to log the real client's IPs.
I try to obtain client's IPs on web servers but I can not success up to now. Always I see the load balancer's IP.
I use x-forward-for option but it is not solved the problem. After that I found another option "source 0.0.0.0:80 usesrc clientip" but I got eror while trying to run HAproxy which is about compilation needs with USE_TPROXY option of the HAproxy. I did it, I recompile HAproxy with USE_TPROXY option but does not change anything. what can I do in order to learn real client's IPs.
My linux kernel version is 2.6.32-34 I mean that kernel is support transparent proxy. and I use UBUNTU 10.4 LTS
my config file is here
global
maxconn 100000
uid 99
gid 99
daemon
defaults
option forwardfor except 127.0.0.1
mode http
(1)source 0.0.0.0:80 interface hdr_ip(x-forwarded-for,-1)
(2)source 0.0.0.0:80 usesrc clientip
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen myWeb 0.0.0.0:80
mode http
balance source
option forwardfor header X-Client
option http-server-close
stats enable
stats refresh 10s
stats hide-version
stats scope .
stats uri /lb?stats
stats realm LB2\ Statistics
stats auth admin:xXx
server S1 192.168.1.117:80 check inter 2000 fall 3
server S2 192.168.1.116:80 check inter 2000 fall 3
server S3 192.168.1.118:80 check inter 2000 fall 3
(1)(2) While testing HAproxy I used one of these two lines.
Is somebody help me to learn real IP's of the clients who being request from our servers?