forked from lavaliere/demo-joc-haproxy
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhaproxy.cfg
More file actions
155 lines (137 loc) · 6.31 KB
/
haproxy.cfg
File metadata and controls
155 lines (137 loc) · 6.31 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
####stock haproxy settings####
global
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
log 127.0.0.1 local0
defaults
log global
# option dontlognull
# option dontlog-normal
option logasap
option http-server-close
option redispatch
option abortonclose
option log-health-checks
retries 3
mode tcp
maxconn 3000
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 500
default-server inter 5s downinter 500 rise 1 fall 1
frontend jenkins-cluster-http
bind *:80
reqadd X-Forwarded-Proto:\ http
option forwardfor except 127.0.0.0/8
option httplog
acl host hdr_dom(host) -i beedemo.io
acl api-team url_beg /api-team
acl web-team url_beg /web-team
acl operations-center url_beg /operations-center
mode http
use_backend www-api-team if api-team
use_backend www-web-team if web-team
use_backend www-operations-center if operations-center
default_backend www-default
# define the backend for redirecting any "lost" users to the
# default Jenkins instance
backend www-default
mode http
redirect prefix /operations-center
backend www-operations-center
balance roundrobin
mode http
option httpchk HEAD /operations-center/ha/health-check
server operations-center-1 joc-1.jenkins-operations-center.dev.beedemo.io:8080 check
server operations-center-2 joc-2.jenkins-operations-center.dev.beedemo.io:8080 check
backend www-api-team
balance roundrobin
mode http
option httpchk HEAD /api-team/ha/health-check
server api-team-1-server api-team-1.jenkins-enterprise.dev.beedemo.io:8080 check
server api-team-2-server api-team-2.jenkins-enterprise.dev.beedemo.io:8080 check
backend www-web-team
balance roundrobin
mode http
option httpchk HEAD /web-team/ha/health-check
server web-team-1-server web-team-1.jenkins-enterprise.dev.beedemo.io:8080 check
server web-team-2-server web-team-2.jenkins-enterprise.dev.beedemo.io:8080 check
# Define the static Slave ports for operations-center
frontend operations-center-jnlp
option tcplog
bind *:40001
timeout client 15m
use_backend jnlp-operations-center
# define the backend for JNLP connections to the active
# operations-center instance
backend jnlp-operations-center
option tcplog
timeout server 15m
# Jenkins by default runs a ping every 10 minutes and waits 4
# minutes for a timeout before killing the connection, thus we
# need to keep these TCP raw sockets open for at least that
# long.
option httpchk HEAD /operations-center/ha/health-check
server operations-center-1 joc-1.jenkins-operations-center.dev.beedemo.io:40001 check port 8080
server operations-center-2 joc-2.jenkins-operations-center.dev.beedemo.io:40001 check port 8080
#Define the static Slave ports for api-team
frontend api-team-jnlp
option tcplog
bind *:40002
timeout client 15m
use_backend jnlp-api-team
backend jnlp-api-team
option tcplog
timeout server 15m
# Jenkins by default runs a ping every 10 minutes and waits 4
# minutes for a timeout before killing the connection, thus we
# need to keep these TCP raw sockets open for at least that
# long.
option httpchk HEAD /api-team/ha/health-check
server api-team-1 api-team-1.jenkins-enterprise.dev.beedemo.io:40002 check port 8080
server api-team-2 api-team-2.jenkins-enterprise.dev.beedemo.io:40002 check port 8080
#Define the static Slave ports for web-team
frontend web-team-jnlp
option tcplog
bind *:40003
timeout client 15m
use_backend jnlp-web-team
backend jnlp-web-team
option tcplog
timeout server 15m
# Jenkins by default runs a ping every 10 minutes and waits 4
# minutes for a timeout before killing the connection, thus we
# need to keep these TCP raw sockets open for at least that
# long.
option httpchk HEAD /web-team/ha/health-check
server web-team-1 web-team-1.jenkins-enterprise.dev.beedemo.io:40003 check port 8080
server web-team-2 web-team-2.jenkins-enterprise.dev.beedemo.io:40003 check port 8080
#Define the static SSHD ports for api-team
frontend api-team-ssh
option tcplog
bind *:40012
use_backend ssh-api-team
backend ssh-api-team
option tcplog
option httpchk HEAD /api-team/ha/health-check
server api-team-1 api-team-1.jenkins-enterprise.dev.beedemo.io:40012 check port 8080
server api-team-2 api-team-2.jenkins-enterprise.dev.beedemo.io:40012 check port 8080
#Define the static SSHD ports for web-team
frontend web-team-ssh
option tcplog
bind *:40013
use_backend ssh-web-team
backend ssh-web-team
option tcplog
option httpchk HEAD /web-team/ha/health-check
server web-team-1 web-team-1.jenkins-enterprise.dev.beedemo.io:40013 check port 8080
server web-team-2 web-team-2.jenkins-enterprise.dev.beedemo.io:40013 check port 8080