I am stuffing haproxy in front of 3 riak nodes with HTTP. I want the backend name and/or ip in the response headers. Something like:
X-Proxy-Backend: riak-1 10.0.0.1
or whatever.
How can I make this happen?
I am stuffing haproxy in front of 3 riak nodes with HTTP. I want the backend name and/or ip in the response headers. Something like:
X-Proxy-Backend: riak-1 10.0.0.1
or whatever.
How can I make this happen?
You can use the cookie function to add the serverid into your response. For example:
This will insert a cookie called
SERVERID=A
into the HTTP headers.If you want a header, you can use the srv_id ACL like so:
You'll have to keep it in sync when you add/remove backend servers, but it works.