summaryrefslogtreecommitdiff
path: root/etc/haproxy.cfg
blob: 211b9f0783c141eb18b7f3eb0cb5bffeb420a795 (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
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 2m fastinter 1m downinter 10s observe layer4 check agent-port 1234 agent-check agent-inter 20s weight 255
	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
	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 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
	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 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 check-ssl
	server defiant defiant:11993
	server firebrand firebrand:11993

# 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
	server danielg ipv4@danielg.random.lan:3632 maxconn 6 resolvers dns
	server firebrand ipv4@firebrand.random.lan:13632 maxconn 5
	server defiant ipv4@defiant.random.lan:13632 maxconn 2 weight 50

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