diff --git a/roles/haproxy/templates/haproxy.cfg b/roles/haproxy/templates/haproxy.cfg index 55c7f51a6c..cec85d201a 100644 --- a/roles/haproxy/templates/haproxy.cfg +++ b/roles/haproxy/templates/haproxy.cfg @@ -607,8 +607,14 @@ frontend copr-frontend backend copr-backend balance hdr(appserver) +{% if env == "production" %} server copr-frontend01 copr-frontend01:80 check inter 10s rise 1 fall 2 server copr-frontend02 copr-frontend02:80 check inter 10s rise 1 fall 2 +{% else %} + cookie SERVERID insert indirect nocache + server copr-frontend01 copr-frontend01:80 check inter 10s rise 1 fall 2 cookie copr-frontend01 + server copr-frontend02 copr-frontend02:80 check inter 10s rise 1 fall 2 cookie copr-frontend02 +{% endif %} option httpchk GET /api_3/ # Apache doesn't handle the initial connection here like the other proxy