Say someone makes a http get/post request to api.example.com/a/b
Now say I have 10 servers setup as my backend servers. I want ha proxy to act as a load balancer and during the request handshake respond with:
apiX.example.com/a/b
where X is a number in the range 1..10
If haproxy isn't the right tool for this, what would you suggest?
What benefits to hardware based load balancers offer?
Update
Normally from what I understand of proxies is that haproxy will take a request, and proxy it to a backend server, wait for the response, and then send the response to the client. The client has no idea which backend server responded to their request.
Now if I have 10 backend servers, the haproxy server will be overloaded since it will have to handle the throughput of 10 servers traffic/bandwidth since all requests and responses are going through the haproxy server.
I am curious if haproxy could simple hand of the request to a particular backend server, and then the client will talk directly with the backend server (the backend will be publicly accessible at api3.example.com or api[1..10].example.com)
The client will be making only a single request, so the session will last for a single request only where the client makes a http get/post request and waits for a response, that's it.