aboutsummaryrefslogtreecommitdiffstats
path: root/terminaldweller.com/haproxy/haproxy.cfg
blob: 19e7bacb35abb7dccde55bf3a45c76ee70c7d6e5 (plain) (blame)
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 local0

defaults
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
mode tcp
option tcplog
option dontlognull

#Frontends
frontend front
bind *:80
bind: *.443
mode tcp
timeout client 60s

#ACLs
acl blog-host hdr_sub(host) -i blog.terminaldweller.com
acl mail-host hdr_sub(host) -i mail.terminaldweller.com
acl api-host hdr_sub(host) -i api.terminaldweller.com
acl chat-host hdr_sub(host) -i chat.terminaldweller.com
acl chat-host-s req.ssl_sni -i chat.terminaldweller.com

#Consitions
use_backend blog-backend if blog-host
use_backend mail-backend if mail-host
use_backend api-backend if api-host
use_backend chat-backend-s if chat-host-s
default_backend blog-backend

#Backends
backend blog-backend
mode http
option forwardfor
server blog-host 192.99.102.52:9000 check

backend mail-backend
mode http
option forwardfor
server mail-host 185.126.202.69:80 check

backend api-backend
mode http
option forwardfor
server api-host 192.99.102.52:8008 check

backend chat-backend
mode http
option forwardfor
server chat-host 87.236.209.206:5280 check

backend chat-backend-s
timeout server 60s
timeout client 60s
mode tcp
option forwardfor
option ssl-hello-chk
server chat-host 87.236.209.206:5281 check