Hi
Have anyone configured a java application to log client IP when the java application is running behind haproxy in tcp mode and the haproxy is configured to send the “send-proxy” header. A sample configuration is given below:
frontend myfrontend
bind 0.0.0.0:1000
mode tcp
retries 3
option redispatch
option clitcpka
timeout client 300s
timeout server 300s
option tcplog
default_backend mybackend
backend mybackend
mode tcp
server SERVER-1 1.1.1.1:1000 check send-proxy
The java application is running on the 1.1.1.1 backend server and I want to log the original client IP addresses. Right now when the IP address is logged through InetAddress.getLocalHost();
I am using HAproxy 2.4.4 which is the latest version right now.
Thank you very much.