By default, Haproxy won’t forward visitor IP address to backend servers. To enable Haproxy forward visitor IP address to backend server using HTTP_X_FORWARDED_FOR header, edit haproxy.cfg
vi /etc/haproxy/haproxy.cfg
Add
option forwardfor
This can be added in blocks defaults, frontend, backend or listen.
Example
backend be_lamp mode http log global option forwardfor server fapi 10.0.3.106:80
Leave a Reply