# POST to tomcat fails if more than app. 300KB are uploaded

**URL:** <https://www.ruby-forum.com/t/post-to-tomcat-fails-if-more-than-app-300kb-are-uploaded/188146>\
**Category:** NGINX\
**Created:** [May 6, 2010, 3:35pm UTC](https://www.ruby-forum.com/t/post-to-tomcat-fails-if-more-than-app-300kb-are-uploaded/188146 "2010-05-06T15:35:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [May 6, 2010, 3:35pm UTC](https://www.ruby-forum.com/t/post-to-tomcat-fails-if-more-than-app-300kb-are-uploaded/188146/1 "2010-05-06T15:35:13Z")

</div>

Hi All

My nginx 0.8.35 runs in front of tomcat 6.0.26. Caching is enabled and  
all buffers have default size. Everything worked fine for months until I  
implemented a new servlet waiting for POST requests transmitting XML  
data in the client body to my tomcat.

When the client body is larger than approximately 335KB, tomcat does no  
longer receive the whole body from nginx and times out reading the  
client body from nginx. It looks like nginx first buffers the client  
body (I see the corresponding log entry) and then starts to stream the  
client body (i.e., the beginning of it) to tomcat.

I tried to change all possible buffer sizes in nginx and tomcat,  
disabled proxy buffering, and even verified that nginx has sufficient  
rights and space to write temporary files.

Do you have any ideas how to tell nginx to stream the whole body to  
tomcat? Note that it works fine for client bodies smaller than 335KB.

Regards,  
Marc

Posted at Nginx Forum:

> **[POST to tomcat fails if more than app. 300KB are uploaded](https://forum.nginx.org/read.php?2,83268,83268#msg-83268)**
>
> Hi All My nginx 0.8.35 runs in front of tomcat 6.0.26. Caching is enabled and all buffers have default size. Everything worked fine for months until I implemented a new servlet waiting for POST requests transmitting XML data in the client body to my...
