Nginx 502 Error with iRedMail and CentOS 7
Installing iRedMail is quite a simple process with the provided installation script, but I found with CentOS installations with the GUI enabled the web server would throw 502 errors.
After some tinkering and googling, I’ve come up with a solution to the problem.
The problem specifically? I was getting this in my nginx error log (/var/log/nginx/error.log
):
1 | 2015/10/19 22:28:44 [crit] 25668#0: *2 connect() to unix:/var/run/php-fpm/php-fpm.socket failed (2: No such file or directory) while connecting to upstream, client: 192.168.1.2, server: _, request: "GET /mail/ HTTP/1.1", upstream: "fastcgi://unix:/var/run/php-fpm/php-fpm.socket:", host: "example.com" |
Now apparently this means that there is a permissions problem with nginx communicating to php-fpm. I’m not going to lie, I really have no clue what this means, but here’s what I did to fix it:
1 | ## Make php-fpm listen on port 9000 |
Now because this failed during the initial installation, the services required won’t have started, so start them all up:
1 | systemctl restart uwsgi |
I hope this works for you as it did for me.