Upload Issues with Nginx Reverse Proxy - Part 2

Simon Evans lists at ruby-forum.com
Wed Sep 2 09:11:52 MSD 2009

W. andrew Loe iii wrote:
> I don't have enough information on what you are trying to do to fully
> diagnose your issue, but I do have some notes on uploading with nginx
> that may help.
> Nginx will fully buffer an upload before passing it to the backend
> server, depending on how you look at it this is annoying or very
> helpful. As far as I can see, it creates a file in /tmp/ something
> like /tmp/upload_0000, starts writing to the file, and then
> immediately deletes it. The file still remains open as long as a
> process is connected to it (this is a *nix filesystem feature so you
> can't delete a file that is in use and crash things?). After its
> buffered to disk nginx re-reads it and hurls the whole thing to your
> backend. If this isn't what you want (maybe nginx is on the same
> server anyways so no point in writing, reading and then writing it
> again) you might want to look at the upload module
> (http://www.grid.net.ru/nginx/upload.en.html) that lets you instruct
> nginx to write the file to a folder and then pass to your backend a
> pointer to its location.

I was wondering if it is possible to turn off fully buffering the 
upload, and allowing the upload to stream to the backend servers? I have 
not seen a way to turn it off in the documentation. When we tried to put 
in nginx, it broke the file upload progress monitor, and also other 
checks we do prior to handling the upload request.

The upload module looks interesting to prevent double file writing, but 
would not solve the above issues.
Posted via http://www.ruby-forum.com/.

More information about the nginx mailing list