-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathhaproxy.cfg
More file actions
24 lines (17 loc) · 720 Bytes
/
haproxy.cfg
File metadata and controls
24 lines (17 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
frontend fe_api_ssl
bind 192.168.0.1:443 ssl crt /etc/haproxy/ssl/api.pem no-sslv3 ciphers ...
default_backend be_api
tcp-request inspect-delay 5s
acl document_request path_beg -i /v2/documents
acl is_upload hdr_beg(Content-Type) -i multipart/form-data
acl too_many_uploads_by_user sc0_gpc0_rate() gt 100
acl mark_seen sc0_inc_gpc0 gt 0
stick-table type string size 100k store gpc0_rate(60s)
tcp-request content track-sc0 hdr(Authorization) if METH_POST document_request is_upload
use_backend be_429_slow_down if mark_seen too_many_uploads_by_user
backend be_429_slow_down
timeout tarpit 2s
errorfile 500 /etc/haproxy/errorfiles/429.http
http-request tarpit
backend be_api
...