Upload issue when NGINX actes as reverse proxy

Hi all:

I met an issue when I use NGINX.

When NGINX works as reverse proxy, I try to upload about 300M file to
the
backend webserver, I failed.

  1. I change the entry “client_max_body_size 300m” in nginx.conf, but I
    still
    fail.

  2. It seems that the file is cached by nginx,then re-transmit to
    backend.
    If I want to upload 1GB size file and there is no enough memory in
    reverse-server, it is fail also?

  3. can we set bypass the file uploading ?

anyone can give me some help?

thanks
George

Web G. at 2011-2-25 14:36 wrote:

Hi all:

I met an issue when I use NGINX.

When NGINX works as reverse proxy, I try to upload about 300M file to
the backend webserver, I failed.

  1. I change the entry “client_max_body_size 300m” in nginx.conf, but I
    still fail.
    What’s the error.log show?
  2. It seems that the file is cached by nginx,then re-transmit to backend.
    If I want to upload 1GB size file and there is no enough memory in
    reverse-server, it is fail also?
    No, If there is not enough memory, Nginx will save it to a temporary
    file in the disk. After file uploading completed, Then it will send this
    static temporary file to backend.
    nginx mailing list
    [email protected]
    nginx Info Page


Weibin Y.

Thanks Weibin’s feedback.

I searched a mail with the same issue.
ref: Re: Upload Issues with Nginx Reverse Proxy - Part 2

From the update of Igor, it should be an issue and would be developed.

We do not know the latest status…

It seems that UPLOAD module can not solve the issue.

Anyone has a good method for the issue?

thanks
George

2011/2/25 Weibin Y. [email protected]

----- Valery K. [email protected] wrote:

It seems that UPLOAD module can not solve the issue.

No, it doesn’t seem so. upload module is especially designed for solving this
issue.

Correction: yes, you are right and I am wrong, as long as you are
talking about streaming uploads to the backend.

However, if you want to stream the entire request body without
modifications, why don’t you make clients send requests directly to the
backend?


Regards,
Valery K.

thanks for your info.

Can NGINX bypass and sent it directly to backend ?

thanks
George

2011/2/25 Valery K. [email protected]

----- Web G. [email protected] wrote:

Thanks Weibin’s feedback.

I searched a mail with the same issue.
ref: Re: Upload Issues with Nginx Reverse Proxy - Part 2

From the update of Igor, it should be an issue and would be developed.

We do not know the latest status…

It seems that UPLOAD module can not solve the issue.

No, it doesn’t seem so. upload module is especially designed for solving
this issue.


Regards,
Valery K.

Web G. wrote:

thanks for your info.

Can NGINX bypass and sent it directly to backend ?

It can, but without streaming (with buffering), which is now what you
want as we have already figured out.

 >
 > > We do not know the latest status...
modifications, why don't you make clients send requests directly to


Best regards,
Valery K.

Do anyone meet the same issue Is there a workaround?

How does it solve the issue?
If NGINX works as reverse proxy, it seems the issue is easy to
reproduce. ?

thanks
George

2011/2/25 Web G. [email protected]

Do you mean that it is the configuration issue because of backend server
?
I set the “buffing off”.

2011/2/25 Mark M. [email protected]

On Sun, Feb 27, 2011 at 8:30 AM, Web G. [email protected]
wrote:

thanks for your info.

No, it doesn’t seem so. upload module is especially designed for
Regards,
file. In that case, it was just a matter of upping Apache’s timeout.
In my case, yes. I usually have the upload buffer set to a couple
hundred meg and slower clients wouldn’t hit either the end of the
upload or the buffer limit before Apache had timed out the connection
from nginx. If you’re not buffering though, then probably not relevant
to your issue.

On Fri, Feb 25, 2011 at 9:56 AM, Valery K.
[email protected] wrote:

thanks
mailto:[email protected]> wrote:

It seems that UPLOAD module can not solve the issue.


Regards,
Valery K.


nginx mailing list
[email protected] mailto:[email protected]
nginx Info Page

When I’ve run into this type of issue, usually it’s due to the backend
(Apache in my case) not seeing any activity over the connection that
nginx has made with it, while nginx is buffering the upload to a temp
file. In that case, it was just a matter of upping Apache’s timeout.