nginx is eating my client request - multipart/form-data file upload

Maxim Dounin mdounin at
Mon Dec 15 12:52:14 UTC 2014


On Sun, Dec 14, 2014 at 04:43:51PM +0100, Jason H wrote:

> I am new to nginx, but am familar with low-level HTTP and 
> apache. When I try to do a multipart/form file upload, nginx 
> writes some of the client request body to disk, but never 
> finishes and it never passes it to the down/upstream script.
> My specific setup is I have nginx with /dyn redirected to 
> localhost:1337, where a node.js instance is listening. It 
> works... except for the file upload handler. Also in the config 
> is a /debug which is redirected to localhost:1338, which goes to 
> a simple socket dump server for viewing the post.
> I changed the error log handling to 'info'. It reports storing 
> the client body to a file and when I examine it, it is almost as 
> I expected:
> --boundary_.oOo._MjM5NzEwOTkxMzU2MjA0NjM5MTQxNDA3MjYwOA==
> Content-Type: image/jpeg
> Content-Disposition: form-data; name="file"; 
> filename="dccde7b5-25aa-4bb2-96a6-81e9358f2252.jpg"
> <binary data, supposed to be ~89k>
> The problem with this file is too short, only 81,920 bytes (only 
> 80k, exactly) when the file is 88,963 bytes, it should be 88,963 
> + the header above.... But that is literally only half of it. 


Could you please provide "nginx -V" output, full config, and a 
debugging log for a request which demonstrates the problem?

See for some hints.

Maxim Dounin

More information about the nginx mailing list