Is it possible to manage a sticky table for rate limiting using HAProxy - Lua?
Asked Answered
S

0

7

I am using HAProxy as a load balancer & i have a lua script which returns the backend name to haproxy.cfg. Wanted to implement rate limiting for my application.

I know that we can use sticky tables (as below) in haproxy.cfg to achieve rate limiting.


stick-table type ip size 1m expire 60s store http_req_cnt

acl exceeds_limit hdr_ip(x-forwarded-for,-1),table_http_req_cnt(incoming) ge 10

http-request tarpit if exceeds_limit

http-request track-sc0 hdr_ip(x-forwarded-for,-1)


Wanted to implement the same using lua. Is it possible to access that sticky table using lua.

Thanks in advance.

Schuler answered 20/10, 2018 at 17:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.