This repository has been archived by the owner on Dec 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
haproxy.cfg
60 lines (55 loc) · 1.53 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 local2
maxconn 4000
daemon
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
listen stats-50000
bind {{ api_ip }}:50000
mode http
log global
maxconn 10
timeout client 100s
timeout server 100s
timeout connect 100s
# timeout queue 100s
stats enable
stats hide-version
stats refresh 30s
stats show-node
stats auth admin:password
stats uri /haproxy?stats
{% if ingress_ip != None %}
{% set final_ip = ingress_ip %}
{% else %}
{% set final_ip = api_ip %}
{% endif %}
listen ingress-router-80
bind {{ final_ip }}:80
mode tcp
balance source
{% for num in range(0, workers) %}
server worker{{ num }} {{ cluster }}-worker-{{ num }}.{{ cluster }}.{{ domain }}:80 check inter 1s
{% endfor %}
listen ingress-router-443
bind {{ final_ip }}:443
mode tcp
balance source
{% for num in range(0, workers) %}
server worker{{ num }} {{ cluster }}-worker-{{ num }}.{{ cluster }}.{{ domain }}:443 check inter 1s
{% endfor %}