There are: nginx and tuned php5-fpm, which have successfully worked for themselves for several months, but this afternoon there was a 502 error. Sobno, problem logs standard problem - php5-fpm fell off.
/var/log/nginx/error.log:
2015/10/14 10:33:14 [error] 2122#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 88.156.134.5, server: akirocs.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "akirocs.com" 2015/10/14 10:35:55 [error] 2122#0: *6 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 88.156.134.5, server: akirocs.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "akirocs.com" 2015/10/14 10:36:24 [error] 2122#0: *6 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 88.156.134.5, server: akirocs.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "akirocs.com" 2015/10/14 10:36:30 [error] 2122#0: *6 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 88.156.134.5, server: akirocs.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "akirocs.com" 2015/10/14 10:41:48 [error] 2122#0: *13 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 88.156.134.5, server: akirocs.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "akirocs.com" 2015/10/14 10:42:08 [error] 2122#0: *13 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 88.156.134.5, server: akirocs.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "akirocs.com" 2015/10/14 10:42:17 [error] 2122#0: *13 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 88.156.134.5, server: akirocs.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "akirocs.com"
Yeah. Well, look at php-fpm ...
/var/log/php5-fpm.log :
[11-Oct-2015 07:39:48] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [14-Oct-2015 10:01:43] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [14-Oct-2015 10:12:44] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [14-Oct-2015 10:20:20] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [14-Oct-2015 10:26:50] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful [14-Oct-2015 10:28:09] NOTICE: configuration file /etc/php5/fpm/php-fpm.conf test is successful
Strange. We restart everything - it did not help. We verify the socket on which nginx connects to php5-fpm - everything is fine.
We look at phpinfo in the root of the site - it works ...
We look localhost - we receive standard index.html with a code 200 (OK).
Watch the site - error 502.
Conclusion: php works, nginx works, phpinfo successfully reports on successful work ... but when entering the site we get 502 and write to the log by type
2015/10/14 10:33:14 [error] 2122#0: *1 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 88.156.134.5, server: akirocs.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "akirocs.com"
Question. What the hell doesn’t work when entering php-fpm website, but does phpinfo at the root of this site work fine? Reverses of commits to the morning version of the site (when it was still working) did not help.
I enclose akirocs.conf just below:
server { listen 80; charset utf-8; client_max_body_size 128M; root /home/akirocs/akirocs-web/web; index index.php; server_name akirocs.com; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; include fastcgi_params; try_files $uri =404; } location ~ /\.(ht|svn|git) { deny all; } }