-
Notifications
You must be signed in to change notification settings - Fork 8
/
haproxy.cfg.template
43 lines (37 loc) · 1.08 KB
/
haproxy.cfg.template
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
global
maxconn 10
tune.ssl.default-dh-param 2048
defaults
mode http
timeout client 1m
timeout connect 10s
timeout server 1m
frontend django
acl network_allowed src 127.0.0.0/8 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12
acl url_static url_beg /static
bind :8080
bind :8443 ssl crt /localhost_chain.pem
#http-request deny if !network_allowed
#http-request redirect location https://localhost:8443 if ! { hdr(host) -i localhost }
#http-request redirect scheme https if !{ ssl_fc }
http-request set-header X-Forwarded-Proto https if { ssl_fc }
use_backend static if url_static
default_backend django
option forwardfor
option http-server-close
#frontend ssh
# acl network_allowed src 130.95.0.0/16 127.0.0.0/8 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12
# bind :22
# mode tcp
# tcp-request connection reject if !network_allowed
# default_backend ssh
backend django
balance roundrobin
server django django:8000 maxconn 32
backend static
balance roundrobin
server static static:80 maxconn 32
#backend ssh
# mode tcp
# balance roundrobin
# server ssh ssh:22