summaryrefslogtreecommitdiff
path: root/etc/haproxy.cfg
blob: 1c681470fa5d98500a5d3efc520c9a2fee954cd6 (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
global
	user haproxy
	group haproxy
	ssl-server-verify none
	stats socket /run/haproxy.stats mode 660 group haproxy

defaults
	timeout connect 5s
	timeout client 50s
	timeout server 50s
	balance roundrobin
	option redispatch
	default-server on-error fail-check inter 5m fastinter 1m downinter 10s
	email-alert from haproxy@random.lan
	email-alert to randomdan@random.lan
	email-alert level alert
	email-alert mailers smtp

mailers smtp
	mailer defiant defiant:25
	mailer firebrand firebrand:25

peers randomlan
	peer defiant defiant:1024
	peer firebrand firebrand:1024

resolvers dns
	parse-resolv-conf
	hold valid 10m

# HTTP
listen http
	description Apache HTTP
	bind *:80
	mode http
	default-server send-proxy-v2 observe layer7 check
	server defiant defiant:11080
	server firebrand firebrand:11080

# HTTPS
listen https
	description Apache HTTPS
	bind *:443
	mode tcp
	stick-table type ip size 20k peers randomlan
	stick on src
	default-server send-proxy-v2 observe layer4 check check-ssl
	server defiant defiant:11443
	server firebrand firebrand:11443

# SMTP
listen smtp
	description Exim SMTP
	bind *:25
	mode tcp
	option tcp-check
	tcp-check expect rstring ^220
	default-server send-proxy-v2 observe layer4 check
	server defiant defiant:11025
	server firebrand firebrand:11025

# Submissions
listen submissions
	description Exim SMTP
	bind *:465
	mode tcp
	option tcp-check
	tcp-check expect rstring ^220
	default-server send-proxy-v2 observe layer4 check check-ssl
	server defiant defiant:11465
	server firebrand firebrand:11465

# IMAPS
listen imaps
	description Courier IMAP
	bind *:993
	mode tcp
	stick-table type ip size 20k peers randomlan
	stick on src
	option tcp-check
	tcp-check expect rstring ^\*\ OK
	timeout client 2h
	timeout server 2h
	default-server observe layer4 check check-ssl
	server defiant defiant:11993
	server firebrand firebrand:11993

# MySQL
listen mysql
	description MySQL
	bind *:3306
	mode tcp
	timeout client 2h
	timeout server 2h
	option mysql-check user haproxy post-41
	default-server observe layer4 check on-error mark-down error-limit 1 on-marked-down shutdown-sessions on-marked-up shutdown-backup-sessions
	server defiant defiant:13306
	server firebrand firebrand:13306 backup

# DistCC
listen distcc
	description DistCC
	bind *:3632
	mode tcp
	balance leastconn
	timeout client 5m
	timeout server 5m
	timeout queue 10m
	maxconn 50
	email-alert level emerg
	default-server observe layer4 check
	server danielg ipv4@danielg.random.lan:3632 maxconn 6 resolvers dns weight 25
	server firebrand ipv4@firebrand.random.lan:13632 maxconn 5 weight 24
	server defiant ipv4@defiant.random.lan:13632 maxconn 2 weight 1

# Stats
listen stats
	bind *:9000
	mode http
	stats enable
	stats refresh 30
	stats uri /haproxy/