Empty IP when forwardfor enabled
Hi, I've setup two frontends balanced with Haproxy 1.3.15.7 (excellent software) in another server: Load balancer / \ /\ / \ Frontend 1Frontend 2 I have enabled "option forwardfor". I have set LogFormat in Apache configuration file as follows: LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined but many times the IP field appears empty. I've read on this mailling list that it has something to do with KeepAliveTimeout on Apache. I rised up it from 6 to 15, but no luck. How could I fix this? Thank you
Re: Empty IP when forwardfor enabled
On Monday 19 January 2009 03:19:51 Rodrigo wrote: > Hi, > > I've setup two frontends balanced with Haproxy 1.3.15.7 (excellent > software) in another server: > >Load balancer > / \ > /\ >/ \ > Frontend 1Frontend 2 > > I have enabled "option forwardfor". I have set LogFormat in Apache > configuration file as follows: > > LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" > \"%{User-Agent}i\"" combined > > but many times the IP field appears empty. I've read on this mailling list > that it has something to do with KeepAliveTimeout on Apache. I rised up it > from 6 to 15, but no luck. > > How could I fix this? You probably need "option httpclose". -Rainer
Re: Empty IP when forwardfor enabled
On Mon, Jan 19, 2009 at 3:19 AM, Rodrigo wrote: > LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" > \"%{User-Agent}i\"" combined > > but many times the IP field appears empty. I've read on this mailling list > that it has something to do with KeepAliveTimeout on Apache. I rised up it > from 6 to 15, but no luck. > > How could I fix this? Hi Rodrigo Use mod_rpaf, normal log config, and you'll be fine. The variable doesn't appear in the next requests because haproxy doesn't handle keepalive yet. So next requests are passed unchanged. Or as suggested Rainer, don't use keepalive : option httpclose. But that's a lower performance (for the end-user) thing : IE gets very slow without keepalive. -- Patrick