-
Notifications
You must be signed in to change notification settings - Fork 11
/
sol-haproxy.cfg
102 lines (90 loc) · 4.02 KB
/
sol-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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
log stdout format raw local0
maxconn 20000
user haproxy
group haproxy
ssl-default-server-options force-tlsv12
ssl-default-bind-options force-tlsv12
ca-base /etc/ssl/certs
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode tcp
option tcplog
log global
option dontlognull
timeout client 5m
#---------------------------------------------------------------------
# dedicated stats page
#---------------------------------------------------------------------
listen stats
mode http
bind :22222
stats enable
stats uri /haproxy?stats
stats realm Haproxy\ Statistics
stats auth admin:SOMEPW
stats refresh 30s
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend main_https_listen
bind *:443
tcp-request inspect-delay 5s
tcp-request content accept if { req_ssl_hello_type 1 }
#---------------------------------------------------------------------
# Common HAProxy nodes configuration
#---------------------------------------------------------------------
# -------------------------------
# ACLs
# -------------------------------
acl acl_sol req.ssl_sni -i solana-main-lb.example.com
acl acl_solws req.ssl_sni -i solana-mainws-lb.example.com
# -------------------------------
# Conditions
# -------------------------------
use_backend backend_sol if acl_sol
use_backend backend_solws if acl_solws
#---------------------------------------------------------------------
# Backends
#---------------------------------------------------------------------
# Solana RPC
backend backend_sol
description Solana
default-server init-addr libc no-tls-tickets check inter 10000 on-marked-down shutdown-sessions
timeout connect 5s
timeout server 180s
retries 2
balance first
option httpchk
http-check connect port 443 ssl sni solana-main-a.example.com
http-check send meth GET uri /health ver HTTP/1.1 hdr host solana-main-a.example.com
http-check expect string ok
server solana-main-a.example.com solana-main-a.example.com:443 check-sni solana-main-a.example.com ca-file ca-certificates.crt
http-check connect port 443 ssl sni solana-main-b.example.com
http-check send meth GET uri /health ver HTTP/1.1 hdr host solana-main-b.example.com
http-check expect string ok
server solana-main-b.example.com solana-main-b.example.com:443 check-sni solana-main-b.example.com ca-file ca-certificates.crt backup
# Solana WS
backend backend_solws
description Solana WebSockets
default-server init-addr libc no-tls-tickets check inter 10000 on-marked-down shutdown-sessions
timeout connect 5s
timeout server 180s
timeout tunnel 3600s
retries 2
balance first
option httpchk
http-check connect port 443 ssl sni solana-main-a.example.com
http-check send meth GET uri /health ver HTTP/1.1 hdr host solana-main-a.example.com
http-check expect string ok
server solana-main-a.example.com solana-mainws-a.example.com:443 check-sni solana-main-a.example.com ca-file ca-certificates.crt
http-check connect port 443 ssl sni solana-main-b.example.com
http-check send meth GET uri /health ver HTTP/1.1 hdr host solana-main-b.example.com
http-check expect string ok
server solana-main-b.example.com solana-mainws-b.example.com:443 check-sni solana-main-b.example.com ca-file ca-certificates.crt backup