# Mod\_proxy, compression, and chunked responses

**URL:** <https://www.ruby-forum.com/t/mod-proxy-compression-and-chunked-responses/207644>\
**Category:** NGINX\
**Created:** [May 30, 2011, 9:34pm UTC](https://www.ruby-forum.com/t/mod-proxy-compression-and-chunked-responses/207644 "2011-05-30T21:34:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [May 30, 2011, 9:34pm UTC](https://www.ruby-forum.com/t/mod-proxy-compression-and-chunked-responses/207644/1 "2011-05-30T21:34:56Z")

</div>

I have an application server behind nginx that may output chunked  
responses, and would like to use compression for them as I do for  
ordinary responses.

Is that possible with nginx? If it is, is it possible in a way that  
nginx compresses stuff on the fly and sends chunked (compressed)  
responses itself rather than buffering the original response and  
sending a non-chunked response itself? (That would defeat the purpose  
of the chunked responses.)

---

<div class="post-metadata">

**Author:** ![fxn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/77aa72/32.png) [@fxn](https://www.ruby-forum.com/u/fxn)\
**Post date:** [June 5, 2011, 6:42pm UTC](https://www.ruby-forum.com/t/mod-proxy-compression-and-chunked-responses/207644/2 "2011-06-05T18:42:39Z")

</div>

On Mon, May 30, 2011 at 9:33 PM, Xavier N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have an application server behind nginx that may output chunked  
> responses, and would like to use compression for them as I do for  
> ordinary responses.
> 
> Is that possible with nginx? If it is, is it possible in a way that  
> nginx compresses stuff on the fly and sends chunked (compressed)  
> responses itself rather than buffering the original response and  
> sending a non-chunked response itself? (That would defeat the purpose  
> of the chunked responses.)

It does not seem to work. It compresses the payload of the application  
server.
