# Setting content-length if app doesn't know what it is

**URL:** <https://www.ruby-forum.com/t/setting-content-length-if-app-doesnt-know-what-it-is/241755>\
**Category:** NGINX\
**Created:** [April 28, 2015, 10:51pm UTC](https://www.ruby-forum.com/t/setting-content-length-if-app-doesnt-know-what-it-is/241755 "2015-04-28T22:51:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [April 28, 2015, 10:51pm UTC](https://www.ruby-forum.com/t/setting-content-length-if-app-doesnt-know-what-it-is/241755/1 "2015-04-28T22:51:04Z")

</div>

Behind my web server is an application that doesn’t include  
content-length  
headers because it doesn’t know what it is. I’m pretty sure this is an  
application issue but I promised I’d come here and ask the question - is  
there a way to have nginx buffer an entire server response and insert a  
content-length header if none has been provided (i.e. by \*-fpm, upstream  
proxy, etc)?

---

<div class="post-metadata">

**Author:** ![CJ\_Ess](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c68b51/32.png) [@CJ\_Ess](https://www.ruby-forum.com/u/CJ_Ess)\
**Post date:** [April 29, 2015, 1:58pm UTC](https://www.ruby-forum.com/t/setting-content-length-if-app-doesnt-know-what-it-is/241755/2 "2015-04-29T13:58:24Z")

</div>

Hello!

On Tue, Apr 28, 2015 at 04:50:26PM -0400, CJ Ess wrote:

> Behind my web server is an application that doesn’t include content-length  
> headers because it doesn’t know what it is. I’m pretty sure this is an  
> application issue but I promised I’d come here and ask the question - is  
> there a way to have nginx buffer an entire server response and insert a  
> content-length header if none has been provided (i.e. by \*-fpm, upstream  
> proxy, etc)?

No.

–  
Maxim D.

> **[nginx](http://nginx.org/)**
