When nginx cannot connect to the your php fpm sock | 07.12.2020
<p>Today was one of those days when I got an error on my play server out of nowhere. I hadn't changed much in the last few days, so I was a little confused about that. One of the websites was unable to work. I received a <a href="https://tools.ietf.org/html/rfc2616#section-10.5.3">502 Bad Gateway</a> error. The error log from Nginx showed the following:</p> <p><code><code></code></code></p> <pre>2020/12/07 20:22:00 [crit] 1846#1846: 5 connect() to unix:/var/run/php/example.sock failed (2: No such file or directory) while connecting to upstream, client: 89..., server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/website.sock:", host: "www.website.de" 2020/12/07 20:22:00 [crit] 1846#1846: 5 connect() to unix:/var/run/php/example.sock failed (2: No such file or directory) while connecting to upstream, client: 89..., server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/example.sock:", host: "www.example.com" 2020/12/07 20:22:01 [crit] 1846#1846: 5 connect() to unix:/var/run/php/example.sock failed (2: No such file or directory) while connecting to upstream, client: 89..., server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/example.sock:", host: "www.example.com" 2020/12/07 20:22:47 [crit] 1878#1878: 127 connect() to unix:/var/run/php/example.sock failed (2: No such file or directory) while connecting to upstream, client: 89..., server: example.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/example.sock:", host: "www.example.com" 2020/12/07 20:23:45 [crit] 1878#1878: 147 connect() to unix:/var/run/php/example.sock failed (2: No such file or directory) while connecting to upstream, client: 207..., server: example.com, request: "GET /2017-April-Marek-Konwa HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/example.sock:", host: "www.example.com" 2020/12/07 20:24:24 [crit] 1878#1878: 288 connect() to unix:/var/run/php/example.sock failed (2: No such file or directory) while connecting to upstream, client: 36..., server: example.com, request: "GET /video-277.html?fbclid=IwAR2j2xofNyjzUh0hbnweMESDGhYIdC0qMn1IR5qDln8vktcedR-6LPv_k68 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/example.sock:", host: "www.example.com", referrer: "https://l.facebook.com/"</pre> <p>