How can you configure the nginx `client_max_body_size` equivalent in HAProxy

I’m trying to upload some files that are too large, and I can’t figure out how to configure the request size limit.

There is no such limit in haproxy.

What problem are you trying to solve? Do you want to limit the body size in haproxy or are you troubleshooting an upload problem?

Trying to troubleshoot an upload problem.

That’s odd.

I’m running a private Docker registry behind HAProxy. It usually works just fine, but when uploading a particularly large image containing some machine learning models, it fails each time.

Maybe the issue is actually coming from the registry?

In that case I’d suggest to enable logging on haproxy, so we can see how it fails and why.

Something like this:

global
 log 127.0.0.1 syslog debug
defaults
 log global
 mode http
 option httplog

Make sure you have a active syslog server on 127.0.0.1.

Hey Patrick,

I am facing the exact same problem. Trying to run my docker registry behind HAProxy. Pushing images to the registry works fine for small images, but it fails for larger ones.

Were you able to resolve this?
Best regards,
prasath

It was cloudflare not haproxy

Hi thanks, can you explain what exactly went wrong on the cloudflare side? I am using letsencrypt, maybe it suffers from the same issue.

I need to set limit to client request body like in nginx. Plz suggest the alternative in haproxy