HAProxy community

Chunked transfer encoding in haproxy

Hi, devs,

Since haproxy support ‘mode http’ in frontend, does it support ‘Chunked transfer encoding’(which is only supported in http1.1) related configurations (disable/enable and so on)? I’ve found nothing about haproxy on this so far. Thanks in advance.

Yes, it is supported and there is nothing to configure.

So it’s all depends on the backends, right?

One more question, how does haproxy would handle those chunks?Directly forward those chunks in any cases or haproxy would PROBABLY rearrange those chunks (such as buffering or so)?

I knew one that if chunked, haproxy won’t do compression even if configured.

One more…
Can or would haproxy support chunk itself which would work like nginx chunked_transfer_encoding on configuration?

Haproxy doesn’t modify or otherwise touch the HTTP payload, unless you configure haproxy to do so, which happens with compression, as you said.

And sure, compression has limitations, but that only affects compression.

Why would we need this?

Can you tell me what problem you are trying to solve?

Can you tell me what problem you are trying to solve?

I just wonder why haproxy don’t provide this chunk function as nginx do. Since haproxy can work in Layer7, haproxy may have the ability to do more HTTP things.

Well, the nginx configuration has exactly one singe use-case, as per the documentation:

Allows disabling chunked transfer encoding in HTTP/1.1. It may come in handy when using a software failing to support chunked encoding despite the standard’s requirement.

And because haproxy is a proxy and nginx is a webserver, nginx is far more likely to actually see such non-compliant software.

Thanks again @lukastribus