0
votes

I am trying to come up with a haproxy configuration for a cluster of rest servers where the creation of a resource should be sent in round-robin to the servers

POST /somecollection

responds with the created resource uri (eg /collection/instance01 )

but then any further use of the created resources

GET /collection/instance01/blah PUT /collection/instance01/foo DELETE /collection/instance01/

must be sticky to the server instance that handled the POST (where the resource has been created).

And I would like to do that without cookies :-)

Any ideas ?

1

1 Answers

0
votes

One way to achieve this is via cookie:

Example:

backend rest_backend
  ...
  cookie __sticky_rest insert indirect nocache

  server rest1 x.x.x.1:xxxx cookie 1
  server rest2 x.x.x.2:xxxx cookie 2
  ...