Hi.

On 2023-10-17 (Di.) 16:46, Gilles Van Vlasselaer wrote:
Hi, we are currently migrating servers and decided to drop NGINX in favour of HAProxy, however we had issues in the past where people would bomb us with massive file uploads on some services. Is there an equivalent like nginx's 'client_max_body_size' directive?

For header can you use this.
http://docs.haproxy.org/2.8/configuration.html#tune.http.maxhdr

I would try to use one of these.
http://docs.haproxy.org/2.8/configuration.html#7.3.6-req.body_len
http://docs.haproxy.org/2.8/configuration.html#7.3.6-req.body_size

Here is a example from the doc to check for a specific Content-length.

http-request deny if METH_POST { req.hdr_cnt(Content-length) eq 0 }

or

http-request deny if METH_POST { req.body_len ge YOUR_MAX_BODY_LEN }


Thanks in advance,

Gilles Van Vlasselaer

Regards
Alex

Reply via email to