thanks for your answer,

yep that´s right -  only option forwardfor and I see the right ip-adressess

thanks for help

Wolfgang

Von: German Gutierrez [mailto:[email protected]]
Gesendet: Mittwoch, 20. März 2013 11:07
An: Wolfgang Routschka
Betreff: Re: Client-IP in Header


At first look, without going to haproxy docs, I'd say you should use X-Client 
on your apache configuration or X-Forwarded-For in your haproxy configuration 
.....

--
Germán Gutiérrez

OLX Operation Center OLX Inc.
Buenos Aires - Argentina

Phone: 54.11.4775.6696
Mobile: 54.911.5669.6175
Skype: errare_est
Email/GTalk: [email protected]<mailto:[email protected]>
El 20/03/2013 06:59, "Wolfgang Routschka" 
<[email protected]<mailto:[email protected]>> 
escribió:
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<http://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<http://192.168.1.57:80>

backend static
        server web02 192.168.1.58:80<http://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


Reply via email to