I've setup HAProxy with the
option forwardfor
option so it'll pass on the user's IP to PHP via $_SERVER[ "HTTP_X_FORWARDED_FOR" ].
If the page request isn't a POST it's populated fine but if it is then it won't be populated. Any ideas where I've gone wrong?
Thanks everyone!
My whole HAProxy conf file for reference:
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 4096
#chroot /usr/share/haproxy
user haproxy
group haproxy
daemon
#debug
#quiet
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
maxconn 4096
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen webfarm :80
mode http
balance roundrobin
option forwardfor
server webA 192.168.240.4 weight 1 maxconn 2048 check
server webB 192.168.240.3 weight 1 maxconn 2048 check
listen smtp :25
mode tcp
option tcplog
balance roundrobin
server smtp 192.168.240.4:25 check
From the HAProxy Manual:
So you can try the httpclose option, but I would try it after hours or in test in case of a performance penalty?