-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhaproxy.cfg.template
52 lines (44 loc) · 1.22 KB
/
haproxy.cfg.template
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
user root
group root
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL).
ssl-default-bind-ciphers kEECDH+aRSA+AES:kRSA+AES:+AES256:RC4-SHA:!kEDH:!LOW:!EXP:!MD5:!aNULL:!eNULL
# Stats required for this module to work
# https://github.com/observing/haproxy#haproxycfg
stats socket /tmp/haproxy.sock level admin
defaults
mode http
timeout connect 5000
timeout client 50000
timeout server 50000
frontend stats
bind 0.0.0.0:8081
mode http
stats enable
stats hide-version
stats uri /
{{#dns-srv "_frontend._tcp.marathon.mesos"}}
frontend sample
bind 0.0.0.0:8080
mode http
balance roundrobin
option http-server-close
option forwardfor
{{#each this}}
server frontend-{{@index}} {{ip}}:{{port}} check weight {{weight}}
{{/each}}
{{/dns-srv}}
{{#dns-a "cluster.example.com"}}
frontend sample2
bind 0.0.0.0:8081
mode http
backend sample2
balance leastconn
{{#each this}}
server {{name}} {{ip}}:80 check
{{/each}}
{{/dns-a}}