I was having an issue with random 502 gateway errors using nginx and php-fpm. In my case I discovered a scenario where various php.ini error_log settings and error_reporting lev
I have a similar problem that resolved by disabling PHP warnings, however, I think the problem has something to do with NGINX configuration of the buffers which the error logging uses. The error only triggers after a certain number of warning messages are queued, and seems to be quite predictably repeatable; but I can't figure out what settings are involved so have shut off the warnings until I can resolve the settings that are broken.