Tech Consultant. Backend Developer. Frontend Developer. Designer. Adventure Time Super Fan.
connect() failed (111: Connection refused) while connecting to upstream, client ….
If you are getting this error suddenly and intermittently, this may be due to issues resolving localhost intermittently, perhaps intermittently when attempting IPv6 vs IPv4.
I was able to solve the problem by changing my references to localhost to 127.0.0.1 in my nginx configs.