Quantcast
Channel: Serverphorums.com - HAProxy
Viewing all articles
Browse latest Browse all 5112

Rate limiting on part of the URL path (no replies)

$
0
0
Hello,

I'm using haproxy 1.5.12 and I'm trying to do rate limiting based on a part
of a URL requested.

Requests I want to track and limit have the following form:
https://host1.domain.tld/field1/field2/morestuff?query……
- field1 is a word like "user" or "data", there are 2 to 4 of them and
they're known to me.
- field2 is what I really want to track, it's formed of 3 letters that
never change and followed by several characters including lower and upper
case letters, numbers, dashes (-) and underscores (_). The field length is
not fixed however it will always be in second position in the path.
Examples for this field are abc_PT4gWk-42, abc1234 or abc-vb8WQ_2

My goal is have a table storing these with a counter for each, block if we
get more than 10 per second and return an error message like "too many
requests". I'd like to be able to query this table to have an idea of the
abusers, this should be trivial by parsing the output of "show table".

I have not been able to generate a config that does something similar and
am quite confused by the stick store-request which accept path but not
path_reg. Am I actually in the right direction ?

Any help would be greatly appreciated.

Thanks

--
Pierre

Viewing all articles
Browse latest Browse all 5112

Trending Articles