-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhaproxy.conf.js
More file actions
49 lines (44 loc) · 1.93 KB
/
haproxy.conf.js
File metadata and controls
49 lines (44 loc) · 1.93 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
module.exports = function haproxyConf(maxconn, port, backends, chainspec_name) {
return `global
\tmaxconn ${maxconn}
defaults
\tlog\tglobal
\tmode\thttp
\toption\thttplog
\toption\tdontlognull
\ttimeout connect 5000
\ttimeout client 20000
\ttimeout server 20000
frontend stats
\tbind *:8404
\tstats enable
\tstats uri /stats
listen mainnet_metrics
\tbind *:8888
\tbalance roundrobin
\thttp-response set-header Access-Control-Allow-Origin "http://localhost:8080"
\thttp-response set-header Access-Control-Allow-Methods "GET, POST, OPTIONS"
\thttp-response set-header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Accept-Encoding"
\tserver www1 116.202.217.126:8888 maxconn 50 check inter 10s
listen testnet_metrics
\tbind *:8889
\tbalance roundrobin
\thttp-response set-header Access-Control-Allow-Origin "http://localhost:8080"
\thttp-response set-header Access-Control-Allow-Methods "GET, POST, OPTIONS"
\thttp-response set-header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Accept-Encoding"
\tserver www1 95.216.44.9:8888 maxconn 50 check inter 10s
listen www
\tbind *:${port}
\tbalance roundrobin
\tcapture request header origin len 128
\thttp-response set-header Access-Control-Allow-Origin %[capture.req.hdr(0)] if { capture.req.hdr(0) -m found }
\thttp-response set-header Access-Control-Allow-Methods "GET, POST, OPTIONS"
\thttp-response set-header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Accept-Encoding"
\toption httpchk
\thttp-check send meth POST uri /rpc hdr Content-Type application/json body "{ \\"jsonrpc\\": \\"2.0\\", \\"id\\": 1, \\"method\\": \\"info_get_status\\", \\"params\\": []}"
\thttp-check expect string ${chainspec_name}
\tcompression algo gzip
\tcompression type text/html text/plain text/xml text/css text/javascript application/javascript application/json text/json
\tlog stdout format raw local0 info
${backends}`
}