forked from Iglesys347/castor
-
Notifications
You must be signed in to change notification settings - Fork 2
/
haproxy.j2
36 lines (30 loc) 路 752 Bytes
/
haproxy.j2
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
global
external-check
insecure-fork-wanted
log stdout format raw local0 info
defaults
timeout client 60s
timeout connect 5s
timeout server 60s
timeout http-request 60s
log global
frontend loadbalancer
mode tcp
bind :8080
use_backend tors
listen stats
bind :1337
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /
stats admin if LOCALHOST
backend tors
balance leastconn
option external-check
external-check path "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
external-check command "/usr/local/etc/haproxy/check-tor.sh"
{%- for host in tor_hosts %}
server tor{{loop.index}} {{host}}:9050 check fall 5 rise 2 inter 7s
{%- endfor %}