I recently updated php-fpm from 5.4.16 to 5.5.16. After the update, Nginx comes up with 502 bad gateway error. Googling the error pointed me to look into permission of php socket file.
In php-fpm 5.4.16, if no value is given to listen.mode, php socket file is assumed to 0666.
But in php-fpm 5.5.16, if no value is given to listen.mode, php socket file is assumed to 0660.
That is why Nginx no longer has permission to php socket and occurs 502 error.