Connection management of sync gateway

It’s hard to tell exactly what’s going on from the information provided, but a few questions:

  1. Have you already reviewed the documentation here?
    http://developer.couchbase.com/documentation/mobile/current/develop/guides/sync-gateway/nginx/configuring-nginx-for-sync-gateway/index.html
    In particular I’m wondering whether the proxy_read_timeout setting would help avoid the “upstream timed out” errors.
  2. What version of Sync Gateway are you running? There are some enhancements in SG 1.2 related to closing half-closed connections. In this case you look like you’ve might have the opposite scenario - connections are closed on SG but open on nginx - but the underlying cause might still be addressed by the improved connection termination on the SG side.