forked from rosconap/scale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhaproxy.cfg.j2
57 lines (51 loc) · 1.5 KB
/
haproxy.cfg.j2
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
global
daemon
stats socket /var/run/haproxy.sock level admin
stats bind-process 1
maxconn 1000
pidfile /var/run/haproxy-t1.pid
log 127.0.0.1 local0
log 10.7.0.17 local0
tune.bufsize 16384
tune.maxrewrite 1024
spread-checks 4
nbproc 1
defaults
errorfile 503 /etc/haproxy-shared/errors/503.http
errorfile 502 /etc/haproxy-shared/errors/502.http
mode http
timeout connect 15s
timeout client 60s
timeout server 150s
timeout queue 60s
timeout http-request 15s
timeout http-keep-alive 15s
option redispatch
option dontlognull
balance roundrobin
userlist stats-auth
group admin users admin
user admin insecure-password hadmin
frontend http-in
bind *:80
default_backend webfarm
backend webfarm
server std-web-1 10.142.185.5:80 maxconn 10 check
{% for host in groups['webfarm'] %}
server {{ host }} {{ hostvars[host]['ansible_ssh_host'] }}:80 maxconn 10 check
{% endfor %}
userlist UsersFor_HAProxyStatistics
group admin users admin
user admin insecure-password hadmin
listen HAProxy-Statistics *:443
mode http
stats enable
stats uri /stats
option contstats
stats refresh 10s
#stats show-node
#stats show-legends
acl AuthOkay_ReadOnly http_auth(UsersFor_HAProxyStatistics)
acl AuthOkay_Admin http_auth_group(UsersFor_HAProxyStatistics) admin
stats http-request auth realm HAProxy-Statistics unless AuthOkay_ReadOnly
stats admin if AuthOkay_Admin