-
Notifications
You must be signed in to change notification settings - Fork 0
/
haproxy.cfg.tmpl
54 lines (42 loc) · 1.33 KB
/
haproxy.cfg.tmpl
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
global
maxconn 2000
pidfile /var/run/haproxy.pid
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
# echo "" | nc -U /var/run/haproxy.sock
stats socket /var/run/haproxy.sock mode 777
resolvers docker
nameserver dns "${DNS_TCP_ADDR}:${DNS_TCP_PORT}"
defaults
log global
mode http
option dontlognull
option forwardfor
option httpclose
option httplog
retries 3
timeout check 5s
timeout client 5s
timeout connect 10s
timeout server 10s
frontend web
bind *:80
mode http
option http-server-close
option forceclose
default_backend application-backend
backend application-backend
{{range gets "/app/servers/*"}} server {{base .Key}} {{.Value}}:80 check resolvers docker resolve-prefer ipv4
{{end}}
listen stats
bind *:9000
mode http
#This is the virtual URL to access the stats page
stats uri /haproxy_stats
#Authentication realm. This can be set to anything. Escape space characters with a backslash.
stats realm HAProxy\ Statistics
#The user/pass you want to use. Change this password!
stats auth admin:admin
#This allows you to take down and bring up back end servers.
#This will produce an error on older versions of HAProxy.
stats admin if TRUE