-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathhaproxy.cfg.tmpl
29 lines (26 loc) · 993 Bytes
/
haproxy.cfg.tmpl
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
global
maxconn 1000
max-spread-checks 10000
defaults
mode http
timeout connect 5000
timeout client 600000
timeout server 600000
timeout tunnel 0
timeout check 5000
frontend http-proxy
bind 127.0.0.1:8080
mode http
# These five lines is a fix for torrent
acl local_retracker url -i -m beg http://retracker.local/
acl bt_announce urlp(info_hash) -m found
acl port0 urlp(port) 0
http-request reject if local_retracker
http-request set-query %[query,regsub(^port=0,port=1),regsub(&port=0,&port=1)] if bt_announce port0
http-request add-header Proxy-Authorization "$auth_header"
default_backend proxy-be
backend proxy-be
balance first
default-server inter 60s fall 2 rise 3
option httpchk CONNECT www.google.com:443 "HTTP/1.1\r\nProxy-Authorization: $auth_header"
server proxy$counter $host:$direct_port ssl sni str($host) verify required verifyhost $host ca-file /etc/ssl/certs/ca-bundle.crt check