fixed 502 bad gateway using Nginx

ref http://www.nginxtips.com/502-bad-gateway-using-nginx/