I’ve found that, for whatever reason, when I am requesting the same URI (proxied by haproxy to the back-end Apache server, of course) in rapid succession - perhaps once every 2 seconds or so - X-Forwarded-For is not being sent to the Apache server. I have a separate log file for proxied requests as determined by the presence of X-Forwarded-For and not, as well as a PHP script that was echoing the value of the headers, and the IP of my client just isn’t there. However if I wait 10 seconds or so and then request that same URI the X-Forwarded-For is passed as usual.
Is there a reason for this? What’s going on behind the scenes here? It seems unusual. Can anyone shed some light on this? The configuration is very simple; see below.
timeout connect 5000
timeout client 50000
timeout server 50000
server srbe1 126.96.36.199:80