failed (104: Connection reset by peer) while reading response header from upstream, client: If you are getting the above error in nginx logs running in from of upstream servers you may consider doing this as it worked for me: check the ulimit on the machines and ensure it is high enough to handle the load coming in. 'ulimit' on linux, I am told determines the maximum number of open files the kernel can handle. The way I did that? modifying limits: for open files: -------------------------------- add or change this line in /etc/systcl.conf fs.file-max = set soft & hard limits in this file for various users: /etc/security/limits.conf soft nofile soft nofile hard nofile Then reload the system settings withou restarting: sysctl -p nginx settings : -------------------------------- in nginx.conf add/set: worker_rlimit_nofile When setting up upstream servers or not, it is a good idea to keep some connections alive when running on HTTP 1.1. Consider adding this to the upstream block on : keepalive ;