Hello everybody,
I´m from Germany so sorry for my english that´s not very good. I installed
haproxy on a test system for http/https load-balancing.
Today my problem is the forwardfor option that is not right configured because
in my apache logs/header I can´t see the client IP.
In my scenario I want to see the remote client ip address.
Configuration of haproxy is ( I only tested forwardfor option in web01)
frontend http-to-ssl
bind 192.168.1.59:443 ssl crt /etc/haproxy/server.pem
mode http
option http-server-close
acl url_static path_beg /static
acl url_img path_beg /img
use_backend static if url_static
use_backend img if url_img
backend img
option forwardfor header X-Client
server web01 192.168.1.57:80
backend static
server web02 192.168.1.58:80
Apache-Config File is configured for logging in a seperate logfile
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
combined
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\"
\"%{User-Agent}i\"" proxy
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
CustomLog /var/log/httpd/img-access.log combined env=!forwarded
CustomLog /var/log/httpd/img-access.log proxy env=forwarded
How can I configure haproxy for header with the remote-ip?
thanks
Wolfgang