Nginx (all versions since September 2014, but at least 1.7.9, 1.7.10)
sometimes returns HTTP status code 500, when serving pages from
Each time this happens, following conditions hold true:
*) $upstream_cache_status = HIT (so we don’t even hit php-fpm)
*) $body_bytes_sent = 0 (which is strange, because I’ve got an error
defined for http code 500, that is obviously not sent)
I’ve configured an error page for status code 500 which is correctly
on errors from PHP - this was tested for status code 503.
Nginx seems to have a bug here, I guess? Why would it otherwise return a
zero bytes size body?
This happens for about 30-40 requests a day. All other requests (several
thousand) are correctly returning status code 200. Server load/CPU load
I’ve configured fastcgi cache as follows:
fastcgi_cache_path /dev/shm/ngxcache levels=1:2 use_temp_path=off
keys_zone=MYSITE:5M max_size=50M inactive=2h;
Maybe somebody knows advice?
Posted at Nginx Forum: