I have two backend servers, I have to monitor Client IP, by default HAProxy sends server IP not client IP. I have found a similar solution over here but it does not work for my case. My simple configuration file is following
Here is my haproxy.cnf
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
frontend main *:9090
acl url_static path_beg -i /static /javascript /stylesheets
acl url_static path_end -i .jpg .gif .png .css
#Rule for plays request
acl p2_url path_beg -i /plays
use_backend back2 if p2_url
acl valid_path path_beg -i /solr/select
use_backend back1 if valid_path
use_backend static if url_static
default_backend static
backend static
balance roundrobin
server static 127.0.0.1:80 check
backend back1
balance roundrobin
server app40 127.0.0.1:8900 check
backend back2
balance roundrobin
server app31 10.11.21.31:80 check
I want to send client IP when ever back2 is used ( atleast ). How I can update haproxy configuration. I am using Centos 7 with HAProxy 1.5.14