1

Topic: Error: 502 Bad Gateway

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.8
- Deployed with iRedMail Easy or the downloadable installer? Downloadable installer
- Linux/BSD distribution name and version: Ubuntu 22.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
I was unable to access my domain at /mail/. I was getting a 502 Bad Gateway error. I checked some posts online and decided to try to upgrade my version of iRedMail. I upgraded it from 1.6.2 to 1.6.8, going through each release. I also restarted the server after finishing all the upgrades. But the problem still persists.

In the /var/log/nginx/error.log file I see this when I try and access /mail/:
2024/03/09 15:58:00 [error] 950#950: *1 connect() failed (111: Unknown error) while connecting to upstream, client: xx.xx.xx.xx, server: mail.kumars.io, request: "GET /mail/ HTTP/2.0", upstream: "fastcgi://127.0.0.1:9999", host: "mail.kumars.io"

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Error: 502 Bad Gateway

Is php-fpm service running and listening on port 9999?
Check its config file /etc/php/8.1/fpm/pool.d/www.conf.

3

Re: Error: 502 Bad Gateway

That was the problem. it was running on /var/run/php/php8.1-fpm.sock

I switched it to the IP and port and its working fine now.

Thanks for your help.