-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhaproxy.cfg
61 lines (54 loc) · 1.94 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
#---------------------------------------------------------------------
#
# Upment Haproxy configuration for Magento
#
#---------------------------------------------------------------------
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
# turn on stats unix socket
stats socket /var/lib/haproxy/stats
defaults
mode http
log global
option httplog
option dontlognull
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
reqadd X-Forwarded-Proto:\ https
redirect scheme https code 301 if !{ ssl_fc }
http-request redirect prefix https://www.%[hdr(host)] code 301 unless { hdr_beg(host) -i www. }
frontend main
bind *:80
bind *:443 ssl crt /etc/ssl/certs/domaintld.pem
acl url_backend path_sub -i websiteadmin /api/ /merchandiser/ admin_indexers
acl url_backend path_beg -i /blog /.well-known /__adminphp /exportProducts.php /api.php /bunting
use_backend web-backend if url_backend
default_backend app
backend web-backend
timeout client 10m
timeout server 10m
balance roundrobin
server web1-backend 192.168.0.1:80 check
backend app
balance roundrobin
server web2 192.168.0.2:80 check
server web3 192.168.0.3:80 check