Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
HAProxy config for URL-based rate limiting
# At most 10 concurrent connections from a client
acl too_fast fe_sess_rate ge 10
# Matches any path beginning with a given prefix
acl bursts_inclined path_beg -i /client1
# Effectively working as a delay mechanism for clients that are too fast
tcp-request inspect-delay 1000ms
# Fast-path - accept connection if it's not this troublesome client
tcp-request content accept unless bursts_inclined too_fast
# The very fast client gets here meaning they have to wait full inspect-delay
tcp-request content accept if WAIT_END

What version is this good for?


dsuch commented May 23, 2015

Hi @isaacegglestone,

apologies but I haven't spotted your question before.

It's for HAProxy 1.5 and later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment