I have an application where the URL of a request determines which server to forward the request to based on a memcache or database lookup. Currently, it is just round robin, but the state is only stored on one server and that server needs to get all requests with a certain field. So I want to achieve something like the following table:
- /Objects/ABC/ -> Lookup ABC in memcache, returns servera.local ->
Server A
- /Objects/DEF/ -> Lookup DEF in memcache, returns serverb.local ->
Server B
Is this possible with HAProxy? If not, what else can I use? I really don't want to duplicate the request from Server A
to Server B
if Server A
got the request but Server B
is responsible for it.
Another solution that might work for me, is if the application can return something that tells HAProxy which host to resend the request to.