HAProxy - how to append client ip in X-Client-IP and X-Forwarded-For headers?
Solution 1:
You can try setting up custom header, like this:
http-request set-header X-Client-IP %[src]
Or, you can even copy it from X-Forwarded-For header, I think syntax would go something like:
http-request set-header X-Client-IP req.hdr_ip([X-Forwarded-For])
Solution 2:
If you want to use both, you'll need to add the second with an http-request
keyword.
# add X-FORWARDED-FOR
option forwardfor
# add X-CLIENT-IP
http-request add-header X-CLIENT-IP %[src]