-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker_test_haproxy.cfg
More file actions
57 lines (50 loc) · 1.94 KB
/
docker_test_haproxy.cfg
File metadata and controls
57 lines (50 loc) · 1.94 KB
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
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
user haproxy
group haproxy
defaults
log global
mode http
option httplog
option dontlognull
option forwardfor
option http-server-close
contimeout 5000
clitimeout 50000
srvtimeout 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
errorfile 504 /etc/haproxy/errors/504.http
stats enable
stats auth username:password
stats uri /haproxyStats
frontend http-in
bind *:80
# Define your hostnames
acl wordpress_domain_1 hdr(host) -i wp1-docker.ddns.net
acl wordpress_domain_2 hdr(host) -i wp2-docker.ddns.net
acl wordpress_domain_3 hdr(host) -i wp3-docker.ddns.net
## figure out backend to use based on domainname
use_backend wordpress1 if wordpress_domain_1 # your first registered hostname
use_backend wordpress2 if wordpress_domain_2 # your second registered hostname
use_backend wordpress3 if wordpress_domain_3 # your third registered hostname
backend wordpress1 # wp1-docker.ddns.net container
balance roundrobin
option httpclose
option forwardfor
server s1 172.17.0.6:80 # This ip should be the ip of the wordpress container 1
backend wordpress2 # wp2-docker.ddns.net container
balance roundrobin
option httpclose
option forwardfor
server s2 172.17.0.7:80 # This ip should be the ip of the wordpress container 2
backend wordpress3 # wp3-docker.ddns.net container
balance roundrobin
option httpclose
option forwardfor
server s3 172.17.0.8:80 # This ip should be the ip of wordpress container 3