502 Bad Gateway when setting up Email


I followed your tutorial here

the problem is when I try to access my site vma.example.com it’s always shows 502 bad gateway error. Here’s the error log:

2014/04/04 04:11:09 [error] 6926#0: *5 connect() failed (111: Connection refused) while connecting to upstream, client:, server: vma.example.com, request: “GET / HTTP/1.1”, upstream: “fastcgi://”, host: “vma.example.com

We mostly used php5-fpm to listen on

In your vma.example.com you need to change the following line fastcgi_pass; to fastcgi_pass unix:/run/php5-fpm.sock;

Thanks it worked! :)