Upload Issues with Nginx Reverse Proxy - Part 2

Igor Sysoev is at rambler-co.ru
Wed Sep 2 09:37:45 MSD 2009

On Wed, Sep 02, 2009 at 07:11:52AM +0200, Simon Evans wrote:

> 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.

No. I planed nginx as accelerator only which should minimize backend
interaction with client. However, now I'm going to change this.

> The upload module looks interesting to prevent double file writing, but 
> would not solve the above issues.

Igor Sysoev

More information about the nginx mailing list