Add haproxy X-Forwarded-Host request header

Solution 1:

As Joel E Salas has mentioned via a comment, changing the Host header is a slight strange thing to do, but I suppose if the backends only understand certain values it could make sense.

In any event, you can just use the req.hdr fetch sample as a variable to http-request, thusly:

http-request set-header X-Forwarded-Host %[req.hdr(Host)]

You'll have to run that before you run the http-request set-header that rewrites the Host header, but it should work.