-
Notifications
You must be signed in to change notification settings - Fork 0
/
haproxy.cfg
190 lines (168 loc) · 4.74 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
#log loghost local0 info
maxconn 128
uid 99
gid 99
daemon
#debug
#quiet
ssl-server-verify none
defaults
log global
mode http
option tcplog
option dontlognull
retries 3
option redispatch
maxconn 32
timeout connect 5000
timeout client 50000
timeout server 50000
listen stats 192.168.1.112:1936
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /
stats auth tgh:passwd
# stats refresh 10s
# thegreenhundred frontend
frontend http-in
mode http
bind *:80
bind *:8080
bind *:443 ssl crt /etc/ssl/certs/thegreenhundred.com.pem no-tls-tickets ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-RC4-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES128-SHA:AES256-SHA256:AES256-SHA:RC4-SHA
default_backend www
timeout client 86400000
reqadd X-Forwarded-Proto:\ https
option forwardfor
# Define hosts based on domain names
acl xoa hdr_end(host) -i xoa.thegreenhundred.com
acl owncloud hdr_end(host) -i owncloud.thegreenhundred.com
acl freenas hdr_end(host) -i freenas.thegreenhundred.com
acl www-ssh hdr_end(host) -i sshd.thegreenhundred.com
acl router hdr_end(host) -i pfsense.thegreenhundred.com
acl nzbd1 hdr_end(host) -i sab.thegreenhundred.com
acl sick hdr_end(host) -i sick.thegreenhundred.com
acl torrent hdr_end(host) -i p2p.thegreenhundred.com
acl movie hdr_end(host) -i couch.thegreenhundred.com
acl tv hdr_end(host) -i plex.thegreenhundred.com
acl guacd hdr_end(host) -i guac.thegreenhundred.com
acl lxcamdhost hdr_end(host) -i lxc.thegreenhundred.com
acl haproxystats hdr_end(host) -i ha.thegreenhundred.com
## figure out backend to use based on domainname
use_backend xen if xoa
use_backend owncloud if owncloud
use_backend nas if freenas
use_backend sshinabox if www-ssh
use_backend pfsense if router
use_backend sabnzbd if nzbd1
use_backend sickbeard if sick
use_backend transmission if torrent
use_backend couchpotato if movie
use_backend plex if tv
use_backend guacamole if guacd
use_backend lxcwp if lxcamdhost
use_backend haproxy if haproxystats
# backend for thegreenhundred.com
backend www
mode http
balance roundrobin
option httpclose
option forwardfor
server thegreenhundred 192.168.1.130:443 ssl maxconn 1000
backend xen
mode http
timeout server 86400000
timeout connect 5000
balance roundrobin
option httpclose
option forwardfor
server xoa 192.168.1.119:443 ssl maxconn 1000
backend owncloud
mode http
timeout server 8640000
balance roundrobin
option httpclose
option forwardfor
server owncloud 192.168.1.131 ssl maxconn 1000
backend nas
mode http
timeout server 86400000
timeout connect 5000
balance roundrobin
option httpclose
option forwardfor
server freenas 192.168.1.111:443 ssl maxconn 1000
backend sshinabox
mode http
timeout server 86400000
timeout connect 5000
balance roundrobin
option forwardfor
server sshinabox 192.168.1.131:444 ssl maxconn 1000
backend pfsense
mode http
timeout server 8640000
timeout connect 5000
balance roundrobin
option forwardfor
server pfsense 192.168.1.1:80 maxconn 1000
backend sabnzbd
mode http
timeout server 8640000
timeout connect 5000
balance roundrobin
option forwardfor
server hmnetsvcs 192.168.1.133:9090 ssl maxconn 1000
backend sickbeard
mode http
timeout server 86400000
timeout connect 5000
balance roundrobin
option forwardfor
server hmnetsvcs 192.168.1.133:8081 ssl maxconn 1000
backend transmission
mode http
timeout server 86400000
timeout connect 5000
balance roundrobin
option forwardfor
server hmnetsvcs 192.168.1.133:8082 ssl maxconn 1000
backend couchpotato
mode http
timeout server 86400000
timeout connect 5000
balance roundrobin
option forwardfor
server hmnetsvcs 192.168.1.133:5050 maxconn 1000
backend plex
mode http
timeout server 86400000
timeout connect 5000
balance roundrobin
option forwardfor
server hmnetsvcs 192.168.1.133:32400 ssl maxconn 1000
backend guacamole
mode http
timeout server 86400000
timeout connect 5000
balance roundrobin
option forwardfor
server lxc-ubuntu 192.168.1.191:8080 maxconn 1000
backend lxcwp
mode http
timeout server 86400000
timeout connect 5000
balance roundrobin
option forwardfor
server lxc-ubuntu-amd 192.168.1.113:5000 maxconn 1000
backend haproxy
mode http
timeout server 86400000
timeout connect 5000
balance roundrobin
option forwardfor
server haproxy 192.168.1.112:1936 maxconn 1000