forked from mattes/rotating-proxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
haproxy.cfg.erb
43 lines (36 loc) · 818 Bytes
/
haproxy.cfg.erb
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
global
maxconn 1024
daemon
pidfile <%= pid_file %>
defaults
mode http
maxconn 1024
option httplog
option dontlognull
retries 3
timeout connect 5s
timeout client 60s
timeout server 60s
listen stats
bind *:4444
mode http
log global
maxconn 10
timeout client 100s
timeout server 100s
timeout connect 100s
timeout queue 100s
stats enable
stats hide-version
stats refresh 30s
stats show-node
stats uri /haproxy?stats
frontend rotating_proxies
bind *:<%= port %>
default_backend tor
option http_proxy
backend tor
balance leastconn # http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#balance
<% backends.each do |b| %>
server <%= b[:name] %><%= b[:port] %> <%= b[:addr] %>:<%= b[:port] %>
<% end %>