Newer
Older
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
global
maxconn 4096
user haproxy
group haproxy
defaults
mode http
option forwardfor
option httpclose
option httplog
option dontlognull
retries 3
timeout connect 5000
timeout client 50000
timeout server 50000
frontend https-in
mode http
bind *:443 ssl crt-list /etc/haproxy/crt-list crt /etc/haproxy/approved-certs/default.pem
reqadd X-Forwarded-Proto:\ https
# otherdomain.com:
acl https_otherdomain.com hdr(host) -i otherdomain.com
acl https_otherdomain.com hdr(host) -i www.otherdomain.com
use_backend otherdomain.com if https_otherdomain.com
# michielbdejong.com:
acl https_michielbdejong.com hdr(host) -i michielbdejong.com
acl https_michielbdejong.com hdr(host) -i www.michielbdejong.com
use_backend michielbdejong.com if https_michielbdejong.com
frontend http-in
bind *:80
redirect scheme https code 301
# michielbdejong.com:
backend michielbdejong.com
cookie SERVERID insert nocache indirect
server Server michielbdejong.com-backend:80 cookie Server
# otherdomain.com:
backend otherdomain.com
cookie SERVERID insert nocache indirect
server Server otherdomain.com-backend:80 cookie Server