-
Notifications
You must be signed in to change notification settings - Fork 0
/
haproxy.conf.in
52 lines (46 loc) · 1.73 KB
/
haproxy.conf.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
global
log 0.0.0.0 local6
maxconn ${haproxy-conf:maxconn}
nbproc 1
# ulimit-n ${haproxy-conf:ulimit-n}
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 plone0101 127.0.0.1:${ports:instance1} cookie p0101 check maxconn 20 rise 1
server plone0102 127.0.0.1:${ports:instance2} cookie p0102 check maxconn 20 rise 1