title: http 403 error + "readv() failed (104: Connection reset by peer) while reading upstream"
body: <p>Preface: I'm running nginx + gunicorn + django on an amazon ec2 instance using s3boto as a default storage backend. I am free tier. The ec2 security group allows: http, ssh, &amp; https.</p>
  
  <p>I'm attempting to send a multipart/form-data request containing a single element: a photo. When attempting to upload the photo, the iPhone (where the request is coming from) hangs. The photo is around 9.5 MB in size.</p>
  
  <p>When I check the nginx-access.logs:</p>
  
  <p>"POST /myUrl/ HTTP/1.1" 400 5 "-""....</p>
  
  <p>When I check the nginx-error.logs:</p>
  
  <pre><code>[error] 5562#0: *1 readv() failed (104: Connection reset by peer) while reading upstream, client: my.ip.addr.iphone, server: default, request: "POST /myUrl/ HTTP/1.1", upstream: "http://127.0.0.1:8000/myUrl/", host: "ec2-my-server-ip-addr.the-location-2.compute.amazonaws.com"
  
  [info] 5562#0: *1 client my.ip.addr.iphone closed keepalive connection
  </code></pre>
  
  <p>I really cannot figure out why this is happening... I have tried changing the /etc/nginx/sites-available/default timeout settings...</p>
  
  <pre><code>server { ...
  
      client_max_body_size 20M;
      client_body_buffer_size 20M;
  
  
      location / {
         keepalive_timeout 300;
         proxy_read_timeout 300;
      }
  }
  </code></pre>
  
  <p>Any thoughts?</p>