用于RESTful负载平衡的haproxy配置 - 创建resurces

时间:2015-09-09 16:05:29

标签: rest haproxy

我正在努力想出一个haproxy配置 对于创建资源的休息服务器群集 应该循环发送到服务器

POST /somecollection

使用创建的资源uri(例如/ collection / instance01)

进行响应

然后进一步使用创建的资源

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

必须粘贴到处理POST的服务器实例 (已创建资源的地方)。

我想在没有cookies的情况下这样做: - )

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

实现此目标的一种方法是通过cookie

示例

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
  ...