-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhaproxy.cfg
More file actions
92 lines (73 loc) · 2.47 KB
/
haproxy.cfg
File metadata and controls
92 lines (73 loc) · 2.47 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
user haproxy
group haproxy
daemon
# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private
# Default ciphers to use on SSL-enabled listening sockets.
# For more information, see ciphers(1SSL). This list is from:
# https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS
ssl-default-bind-options no-sslv3
defaults
log global
mode http
option httplog
option dontlognull
#reqidel ^X-Forwarded-For:.*
#http-request set-header X-Forwarded-For %[src]
option http-server-close
option forwardfor except 127.0.0.1 header my-X-Forwarded-For
#option forwardfor except 127.0.0.1
#option forwardfor except 192.168.33.0/8
option redispatch
timeout connect 5000
timeout client 50000
timeout server 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
frontend http_front
bind *:80
stats uri /haproxy?stats
# default_backend http_back
# Define hosts
acl host_jenkins hdr(host) -i jenkins.drpl.info
acl host_gitlab hdr(host) -i gitlab.drpl.info
# acl host_web hdr(host) -i drpl.info
# acl host_web hdr(host) -i drpl.info
acl host_var1 hdr(host) -i var1.drpl.info
acl host_var2 hdr(host) -i var2.drpl.info
acl host_web hdr(host) -i drpl.info
## figure out which one to use
use_backend jenkins_cluster if host_jenkins
use_backend gitlab_cluster if host_gitlab
use_backend web_cluster if host_web
use_backend var1_cluster if host_var1
use_backend var2_cluster if host_var2
backend jenkins_cluster
balance roundrobin
server main jenkins:8080 check
backend gitlab_cluster
balance roundrobin
server main gitlab:80 check
backend web_cluster
balance roundrobin
server main varnish1:6081 check
server main varnish2:6081 check
backend var1_cluster
balance roundrobin
server main varnish1:6082 check
backend var2_cluster
balance roundrobin
server main varnish2:6082 check