Reading or modifying HTTP headers requires haproxy to actually parse the HTTP message, which is why http mode is required.
TCP mode means that the entire TCP payload is forwarded from one socket to the other (between frontend and backend, without any HTTP level parsing).
That’s why, when you want to use option forwardfor
, you need to enable HTTP mode.