A bit of further testing shows that HAProxy is doing the right thing
(always putting X-Forwarded-For in the request) as we sent the
requests to Tomcat via Apache, and Apache logs all requests with the
forwardfor IPaddress.
However, Tomcat just seems to drop the X-Forwarded-For header every
once in awhile (Java servlet makes a call to request.getheader and
gets nothing back).
This is bizarre!
Chuck
On Oct 23, 2009, at 9:25 AM, Chuck Koscher wrote:
HAProxy is intermittently inserting X-Forward-For. I've included
option httpclose and I've set maxKeepAliveRequests="1" in Tomcat ,
but it still happens. What else should I be doing? (I'm running
1.3.19)
Thanks
Chuck
=== my config file
global
log /dev/log local0 warning
daemon
# and uid, gid, daemon, maxconn...
defaults
mode http
stats uri /haproxy-stats
stats enable
retries 3
option abortonclose
option httpclose
option redispatch
option forwardfor
maxconn 4096
timeout connect 10000
timeout client 50000
timeout server 50000
# cookie crsrvr insert nocache
frontend crossref *:8000
acl ourl path_beg /openurl
use_backend openurl if ourl
option httpclose
option forwardfor
log global
option httplog
default_backend web
backend openurl
option httpchk GET /openurl/
option httpclose
option forwardfor
balance roundrobin
server cr6 172.20.1.31:8080 maxconn 50 check inter 5000
server cr7 172.20.1.33:8080 maxconn 50 check inter 5000