global
log 127.0.0.1 local6
maxconn ${haproxy-conf:maxconn}
user ${haproxy-conf:user}
group ${haproxy-conf:group}
daemon
nbproc 1
defaults
mode http
option httpclose
# Remove requests from the queue if people press stop button
option abortonclose
# Try to connect this many times on failure
retries 3
# If a client is bound to a particular backend but it goes down,
# send them to a different one
option redispatch
monitor-uri /haproxy-ping
timeout connect 7s
timeout queue 300s
timeout client 300s
timeout server 300s
# Enable status page at this URL, on the port HAProxy is bound to
stats enable
stats uri /haproxy-status
stats refresh 5s
stats realm Haproxy statistics
frontend zopecluster
bind ${haproxy-conf:bind}
default_backend zope
# Load balancing over the zope instances
backend zope
# Use Zope\'s __ac cookie as a basis for session stickiness if present.
appsession __ac len 32 timeout 1d
# Otherwise add a cookie called "serverid" for maintaining session stickiness.
# This cookie lasts until the client\'s browser closes, and is invisible to Zope.
cookie serverid insert nocache indirect
# If no session found, use the roundrobin load-balancing algorithm to pick a backend.
balance roundrobin
# Use / (the default) for periodic backend health checks
option httpchk
# Server options:
# "cookie" sets the value of the serverid cookie to be used for the server
# "maxconn" is how many connections can be sent to the server at once
# "check" enables health checks
# "rise 1" means consider Zope up after 1 successful health check
server plone${ports:instance1} ${hosts:instance}:${ports:instance1} cookie p${ports:instance1} check maxconn 2 rise 1
server plone${ports:instance2} ${hosts:instance}:${ports:instance2} cookie p${ports:instance2} check maxconn 2 rise 1
server plone${ports:instance3} ${hosts:instance}:${ports:instance3} cookie p${ports:instance3} check maxconn 2 rise 1