This repository has been archived by the owner on Mar 31, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
haproxy.cfg
73 lines (53 loc) · 1.73 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
global
maxconn 60000
tune.ssl.default-dh-param 2048
defaults
mode http
balance roundrobin
option redispatch
option forwardfor
timeout queue 5s
timeout connect 5000
timeout client 50000
timeout server 50000
frontend http-in
bind *:80
default_backend Not-Websocket
# Any URL beginning with socket.io will be flagged as 'is_websocket'
acl is_websocket path_beg /socket.io
acl is_websocket hdr(Upgrade) -i WebSocket
acl is_websocket hdr_beg(Host) -i ws
# The connection to use if 'is_websocket' is flagged
use_backend Rustla if is_websocket
maxconn 60000
frontend https-in
#HOW TO: https://www.digitalocean.com/community/tutorials/how-to-secure-haproxy-with-let-s-encrypt-on-ubuntu-14-04
bind *:443 ssl crt /etc/haproxy/certs/api.overrustle.com.pem
default_backend Not-Websocket
# Any URL beginning with socket.io will be flagged as 'is_websocket'
acl is_websocket path_beg /socket.io
acl is_websocket hdr(Upgrade) -i WebSocket
acl is_websocket hdr_beg(Host) -i ws
# The connection to use if 'is_websocket' is flagged
use_backend Rustla if is_websocket
#Lets LE requests come in without pissing off chat
acl letsencrypt-acl path_beg /.well-known/acme-challenge/
use_backend letsencrypt-backend if letsencrypt-acl
listen stats :6969
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /
stats auth username:password
backend Not-Websocket
maxconn 60000
server localhost-9998 localhost:9998 weight 1 maxconn 60000 check
backend Rustla
maxconn 60000
balance source
option http-server-close
option forceclose
server localhost-9998 localhost:9998 weight 1 maxconn 60000 check
backend letsencrypt-backend
server letsencrypt 127.0.0.1:54321