Can't upload big files via nginx as reverse proxy

speedfirst nginx-forum at
Tue Jun 5 07:33:24 UTC 2012


In my env, the layout is:

client <--> nginx <--> jetty

In the client, there is a <input type=file> control. I tried to upload a
file with size of 3.7MB. In the client request, the content type is
"multipart/form-data", and there is an "Expect: 100-continue" header.

Through tcpdump, I could see nginx immediately return an "HTTP/1.1 100
Continue" response, and started to read data. After buffering the
uploaded data, nginx then started to send them to jetty. However in this
time, no "Expect: 100-continue" header was proxied because HTTP/1.0 is

After sending part of data, nginx stopped continuing to proxy the rest
of data, but the connection is kept. After 30s, jetty reports time out
exception and returned an response. Nginx finally proxied this response
back to client.

I simply merged all the tcp segments which was sent from nginx to jetty,
and found only 400K bytes are proxied.

My nginx config is quite simple, just

server {
   listen 80;
   location / {
       proxy_pass http://upstream;

All proxy buffer config was not explicitly set so the default values
were applied. I tried to "proxy_buffering off;" and re-do the experiment
above and find the result was same.

I also tried to observe the temp file written by nginx but it's
automatically removed when everything is done. Any way to keep it?

Therefore, I'm wondering is this expected? Did I make mistakes for
configuring proxy buffers? Do I have to use the third party "upload"
module ( to make it work?

Many thanks.

Posted at Nginx Forum:,227175,227175#msg-227175

More information about the nginx mailing list