# File uploads and client\_body\_temp\_temp problems

**URL:** <https://www.ruby-forum.com/t/file-uploads-and-client-body-temp-temp-problems/144446>\
**Category:** NGINX\
**Created:** [July 29, 2008, 7:12pm UTC](https://www.ruby-forum.com/t/file-uploads-and-client-body-temp-temp-problems/144446 "2008-07-29T19:12:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Nachbaur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@Michael\_Nachbaur](https://www.ruby-forum.com/u/Michael_Nachbaur)\
**Post date:** [July 29, 2008, 7:12pm UTC](https://www.ruby-forum.com/t/file-uploads-and-client-body-temp-temp-problems/144446/1 "2008-07-29T19:12:48Z")

</div>

Hi, I’m running nginx as a reverse proxy for an Apache/mod\_perl  
application, and have a fancy-upload progress bar that measures the  
amount of content uploaded. If the script doesn’t see any progress  
after several seconds, the client-side JavaScript assumes the upload  
has failed for some reason and restarts the upload.

However, now that I have nginx running in front of Apache, it seems to  
be buffering the uploaded content and isn’t sending any of it to  
Apache until the upload finishes (or at least until the upload  
progresses long enough for the client-side to give up and retry). Is  
there any way I can tell nginx to stop buffering and simply send all  
the content to Apache as it recieves it? I only am using nginx for  
SSL and serving static files, so I don’t want it to do anything  
special to my dynamic URIs.

Can anyone help me out with this, or tell me if there’s a way my  
Apache application can detect the upload in-progress within nginx? As  
long as I can watch the upload progress I can be happy, but my  
application needs to be made aware of the upload.

Thank you

---

<div class="post-metadata">

**Author:** ![Michael\_Nachbaur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@Michael\_Nachbaur](https://www.ruby-forum.com/u/Michael_Nachbaur)\
**Post date:** [July 29, 2008, 7:21pm UTC](https://www.ruby-forum.com/t/file-uploads-and-client-body-temp-temp-problems/144446/2 "2008-07-29T19:21:00Z")

</div>

By default this is unfortunately impossible. It’s what forced me to move  
away from nginx and I had to use pound as my main proxy.  
Perhaps there is a third party module somewhere that does this.

Sergej

---

<div class="post-metadata">

**Author:** ![Michael\_Nachbaur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@Michael\_Nachbaur](https://www.ruby-forum.com/u/Michael_Nachbaur)\
**Post date:** [July 29, 2008, 8:00pm UTC](https://www.ruby-forum.com/t/file-uploads-and-client-body-temp-temp-problems/144446/3 "2008-07-29T20:00:49Z")

</div>

I find it hard to believe that, with all these sites working behind  
nginx that there isn’t a better answer than “Switch web servers”.  
There must be someone here doing file uploads, since it is a very  
common webapp requirement.

Is there anything anyone has done to reduce the impact of this  
problem? I already switched from lighttpd to nginx, and I really  
don’t want to have to switch it for yet another “flavour of the month”  
web server.

---

<div class="post-metadata">

**Author:** ![Michael\_Nachbaur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/eb8c5e/32.png) [@Michael\_Nachbaur](https://www.ruby-forum.com/u/Michael_Nachbaur)\
**Post date:** [July 30, 2008, 1:41am UTC](https://www.ruby-forum.com/t/file-uploads-and-client-body-temp-temp-problems/144446/4 "2008-07-30T01:41:00Z")

</div>

On Jul 29, 2008, at 10:37 AM, Michael Nachbaur wrote:

> I find it hard to believe that, with all these sites working behind  
> nginx that there isn’t a better answer than “Switch web servers”.  
> There must be someone here doing file uploads, since it is a very  
> common webapp requirement.
> 
> Is there anything anyone has done to reduce the impact of this  
> problem? I already switched from lighttpd to nginx, and I really  
> don’t want to have to switch it for yet another “flavour of the  
> month” web server.

Unfortunately nginx always buffers file uploads and will not pass  
them to the backend until after the upload is complete. There are two  
modules that can mitigate this factor though that are worth checking  
out. one of them parses the multipart body in nginx and places a file  
on the filesystem your backend can get without parsing. The other one  
does upload progress bars in nginx itself keeping the load and polling  
off of your backends.

[http://www.grid.net.ru/nginx/upload.en.html](http://www.grid.net.ru/nginx/upload.en.html)  
[http://wiki.codemongers.com/NginxHttpUploadProgressModule](http://wiki.codemongers.com/NginxHttpUploadProgressModule)’

'Cheers-  
-Ezra
