-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhaproxy.cfg
More file actions
65 lines (47 loc) · 1.66 KB
/
haproxy.cfg
File metadata and controls
65 lines (47 loc) · 1.66 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
global
pidfile /var/run/haproxy-id-core.pid
user root
maxconn 2048
defaults
mode http
stats enable
stats auth admin:password
stats uri /monitor
stats refresh 5s
retries 5
timeout connect 5000ms
timeout client 30000ms
timeout server 30000ms
timeout http-keep-alive 1s
timeout http-request 15s
timeout queue 30s
timeout tarpit 60s
option httpchk GET /status
option redispatch
option httpclose
option abortonclose
option forwardfor
option http-server-close
option dontlognull
option contstats
balance roundrobin
frontend actn-api-core
bind :5000
monitor-uri /haproxy
acl a_core_host hdr_beg(host) -i dev.core.
acl a_core_host hdr_beg(host) -i dev2.core.
acl a_core_api_path path_beg /api
## routing based on websocket protocol header
acl hdr_connection_upgrade hdr(Connection) -i upgrade
acl hdr_upgrade_websocket hdr(Upgrade) -i websocket
use_backend b_core_live if hdr_connection_upgrade hdr_upgrade_websocket
use_backend b_core_back if a_core_api_path a_core_host
use_backend b_core_front if a_core_host
backend b_core_back
reqrep ^([^\ :]*)\ /api/(.*) \1\ /\2
server srv_core_back_1 127.0.0.1:5001
backend b_core_front
server srv_core_front_1 127.0.0.1:5002
backend b_core_live
timeout server 99999999999s
server srv_core_live_1 127.0.0.1:5003