-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsample_haproxy.cfg
51 lines (40 loc) · 1.14 KB
/
sample_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
### FRONTENDS
frontend web
# Listen to port 80
bind :80
mode http
# ...
# Output to http backend
default_backend web_backend
frontend ssl
# Listen to port 443 and decrypt traffic
bind *:443 ssl crt /etc/haproxy/certs.d/cert.pem no-sslv3
mode http
# ...
# Output to man-in-the-middle backend
default_backend ssl_termination_backend
frontend ssl_termination_frontend
# Listen to port 2802
bind :2802
mode http
# Output to https backend
default_backend ssl_backend
### BACKENDS
backend web_backend
mode http
balance
http-request set-header Host server.com
# ...
# Output to server.com, log as http_server
server http_server server.com:80
backend ssl_termination_backend
mode http
# Output to port 2802, which ssl_termination_frontend listens to
server ssl_termination_server localhost:2802
backend ssl_backend
mode http
balance
http-request set-header Host server.com
# ...
# Output to server.com, log as http_server
server https_server server.com:443 ssl ca-file /etc/haproxy/certs.d/cert.pem sni req.hdr(host)