Can nginx send dynamically-gzipped content without using chunked encoding?

2.5k views Asked by At

There's a server that sends responses to HTTP requests, and these responses have a Content-Length header, but the server is proxied through nginx, which is configured to gzip the responses so they're smaller, but also causes it to use chunked transfer encoding, which doesn't specify a Content-Length. This means that the client doesn't know the response size when it starts receiving it, so, for example, a web browser can't display a progress bar. Is there any way to configure nginx to still gzip the response but compute and send an accurate Content-Length header instead of using chunked encoding?

(This is basically the same as this other question except it's nginx instead of Apache.)

1

There are 1 answers

1
Xavier Lucas On

Set chunked_transfer_encoding off;.