A few weeks ago I noticed in the Google Webmaster tools that a few of my URL's were returning 502's.
This URL returns the 502 for any desktop skin but works fine when on mobile (different skin)
Note that it returns the 502 very quickly, suggesting to me that it is not an execution or some form of timeout.
Besides a few more like this, all other URL's on the site are fine.
The only log entry to help at all is this one;
2015/06/29 09:33:39 [error] 19650#0: *4431763 upstream prematurely closed FastCGI stdout while reading response header from upstream, client: 184.108.40.206, server: sau.com.au, request: "GET /forums/topic/437438-around-the-bay-wrap-up/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.sock:", host: "www.sau.com.au", referrer: "http://www.sau.com.au/forums/forum/100-victoria/"
I have also restarted APC which didn't help. It had only 1.5% fragmentation.
I can't find any limit-reached entries. The server is specced quite high so PHP has a lot of memory, request sizes and also long timeouts.
I tried the following that I read about but no diff.
fastcgi_buffer_size 10240k; fastcgi_buffers 4 10240k;
I'm reluctant to make any big changes because this is only on some pages. One thread suggested updating PHP to 5.5.
I dont know where to look now for further assistance. What should my next step be?
nginx version: nginx/1.6.2 PHP 5.3.3 (fpm-fcgi) (built: Oct 30 2014 20:14:56)
PHP error log has nothing written to it. Error logging is enabled though;
php_admin_value[error_log] = /var/log/php-fpm/www-error.log php_admin_flag[log_errors] = on
dmesg doesn't seem to be updating and there is no kernel.log;
-rw-r--r-- 1 root root 41179 Dec 18 2014 dmesg
I was installing XDebug as proposed by @sa289 in this answer and to do so I needed to update from PHP 5.3 to PHP 5.5. I was hoping that would fix the issue on its own, but it didn't. So, I installed XDebug and added the zend_extension to php.ini, restarted PHP and voilà the 502's are gone. I commented out the zend extension again and the 502's returned. XDebug to the rescue. No firm grasp on the cause or true resolution but this is good enough for me.