I update nginx to 1.4.7 and php to 5.5.12, After that I got the 502 error. Before I update everything works fine.
To those who tried everything in this thread and still stuck: This solved my problem. I updated /usr/local/nginx/conf/nginx.conf
Uncomment the line saying user
user
make it www-data so it becomes: user www-data;
www-data
user www-data;
Save it (root access required)
Restart nginx