HAProxy 配置

  1. # Reference: http://blog.haproxy.com/2012/11/07/websockets-load-balancing-with-haproxy/
  2. listen chat
  3. bind *:80
  4. default_backend nodes
  5. backend nodes
  6. option httpchk HEAD /health
  7. http-check expect status 200
  8. cookie io prefix indirect nocache # using the `io` cookie set upon handshake
  9. server app01 app01:3000 check cookie app01
  10. server app02 app02:3000 check cookie app02
  11. server app03 app03:3000 check cookie app03

例子