Until the last few days we had the following architecture: HAProxy -> 2 Backend servers
Now we have: HAProxy -> Varnish -> 2 Backend servers
Before, HAProxy was setting the "X-FORWARDED-FOR" header correctly every time. Now however, it only sets the header sometimes.
By sometimes I mean: I make a request to a PHP script that prints the contents of $_SERVER (holds the header in discussion).
No matter how many times I make the request, HAProxy won't set the header. IF however, I make a request to my script, and then quickly (before the request ends) I hit refresh (so basically I'm making 2 simultaneous requests), the header is being set.
Did someone stumble upon this very weird issue and can point me in the right direction?
Note: putting varnish in front of HAProxy is not an option.