You can't, HAProxy can only change content in a single line. >From your example, you want to rewrite the URL using information from the Host header, so it won't work.
Well, unless you know in advance the Host header, you could do it by considering it fixed. cheers

