-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhaproxy.cfg
78 lines (68 loc) · 2.02 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
global
# global connection limit
maxconn 50000
# sends logs to stdout
log stdout format raw local0 info
# number of threads
nbthread 2
# ------- HTTP Section ---------
# defaults must be set prior to sections using them (can be redefined later)
defaults
log global
mode http
timeout connect 2s
timeout client 5s
timeout server 5s
# expose route with stats (optional, but recommended)
listen stats
bind 127.0.0.1:9090
stats enable
stats uri /monitor
stats refresh 5s
# http api listener (endpoint where external users will connect)
frontend http-in
bind *:18888
option httplog
default_backend nodeos-http-api
# route access control
acl blacklist path_beg -i /v1/producer
acl blacklist path_beg -i /v1/net
acl blacklist path_beg -i /v1/wallet
acl whitelist path_beg -i /v1
http-request deny if blacklist OR !whitelist
# http backend with multiple nodeos (chain_api_plugin)
backend nodeos-http-api
# load balacing mode (roundrobin,leastconn,first,random,etc...)
balance leastconn
# define the path and method for healthcheck
option httpchk GET /v1/chain/get_info HTTP/1.1
# http 1.1 requires defining a Host
http-check send hdr Host eosrio.io
# add default options for all servers
default-server check
# define member servers
server node1 127.0.0.1:28888
server node2 127.0.0.1:38888
# ------ TCP Section -----------
# redefine defaults for tcp mode
defaults
log global
mode tcp
# different timeouts can be defined here
timeout connect 5s
timeout client 10s
timeout server 10s
# listener for incoming peers
frontend p2p-in
bind *:19876
option tcplog
default_backend nodeos-p2p-nodes
# peering backend
backend nodeos-p2p-nodes
balance leastconn
option httpchk GET /v1/chain/get_info HTTP/1.1
http-check send hdr Host eosrio.io
default-server maxconn 64
# specify peering servers with http ports used for health checking (they must have the chain_api_plugin enabled)
server peer1 127.0.0.1:29876 check port 28888
server peer2 127.0.0.1:39876 check port 38888