-
Notifications
You must be signed in to change notification settings - Fork 0
/
haproxy.cfg
60 lines (53 loc) · 1.47 KB
/
haproxy.cfg
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
53
54
55
56
57
58
59
60
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
defaults
mode http
log global
option httplog
option http-server-close
option dontlognull
option redispatch
option contstats
retries 3
backlog 10000
timeout client 25s
timeout connect 5s
timeout server 25s
# timeout tunnel available in ALOHA 5.5 or HAProxy 1.5-dev10 and higher
timeout tunnel 3600s
timeout http-keep-alive 1s
timeout http-request 15s
timeout queue 30s
timeout tarpit 60s
default-server inter 3s rise 2 fall 3
option forwardfor
listen stats
bind 0.0.0.0:70
stats enable
stats uri /
frontend balancer
bind *:80
mode http
default_backend http_servers
acl is_websocket path_beg /socket
acl is_websocket hdr(Upgrade) -i websocket
use_backend ws_servers if is_websocket
backend http_servers
mode http
option forwardfor
# http-request set-header X-Forwarded-Port %[dst_port]
balance roundrobin
server phoenix-1 127.0.0.1:4000 check
server phoenix-2 127.0.0.1:4100 check
server phoenix-3 127.0.0.1:4200 check
# option httpchk OPTIONS * HTTP/1.1\r\nHost:\ localhost
# option httpchk GET /
# http-check expect status 200
backend ws_servers
balance roundrobin
option http-server-close
option forceclose
server phoenix-1 127.0.0.1:4000 weight 1 maxconn 1024 check
server phoenix-2 127.0.0.1:4100 weight 1 maxconn 1024 check
server phoenix-3 127.0.0.1:4200 weight 1 maxconn 1024 check