uploading files greater than 1MB = connection resets

I discovered the problem, The problem was with nginx

In nginx.conf:

http {
    client_max_body_size 0;
}

I set client_max_body_size to 0. the default was 1M.