File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -117,6 +117,15 @@ frontend main
117117 bind :::80
118118 bind 127.0.0.1:19001 # This is our TLS socket.
119119
120+ # Client rate limiting
121+ # See: https://www.haproxy.com/blog/four-examples-of-haproxy-rate-limiting
122+ stick-table type ip size 100k expire 15s store http_req_rate(10s)
123+ http-request track-sc0 src
124+ http-request deny deny_status 429 if { sc_http_req_rate(0) gt 20 }
125+
126+ # Do we need to whitelist the LBs?
127+ {# acl whitelist src 10.132.111.89 10.132.109.52 #}
128+
120129 # Custom logging format, this is the same as the normal "httplog" in
121130 # HAProxy except information about the TLS connection is included.
122131 log-format %ci:%cp\ [%t]\ %ft\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %sslv/%sslc\ %ST\ %B\ %CC\ %CS\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %hr\ %hs\ %{+Q}r
You can’t perform that action at this time.
0 commit comments