Preserving HTTP header

How to preserve the original ‘Host’ HTTP header in haproxy?


That’s what happens by default.

Hi Deeps,
All HTTP headers and cookies are carried forward to the backend server (i.e. proxy host) unless you explicitly delete or change them.
If your haproxy log does not contain any HTTP host headers, you may want to add such a line to your frontend:

frontend ...
  http-request capture req.hdr(Host) len 45

You should then be able to see the host header in the access.log file.

Hope this helps?