1

Topic: iRedAdmin and NGINX - 502 Bad Gateway

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
======== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): iRedMail-0.9.8
- Linux/BSD distribution name and version: Centos 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB/MySQL (installed by iRedMail)
- Web server (Apache or Nginx): Nginx (installed by iRedMail)
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I have installed IRedMail a few times now without issue. I prepared a new server (fresh install, all components installed during the iRedMail installation), and now suddenly iredadmin does not work. A fresh install generates a "502 Bad Gateway" error.

*I can confirm that the installation of iRedMail proceeded without errors or warning.
*SSL has been installed and is working properly/trusted.
*Webmail (SOGo) access works.
*DNS (A/PTR/MX) is confirmed.

Please assist troubleshooting. Here is the NGINX error log:

2018/09/14 15:25:21 [error] 3291#0: *18 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: $
2018/09/14 15:25:27 [error] 3291#0: *18 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: $
2018/09/14 15:26:40 [error] 3291#0: *18 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: $
2018/09/14 15:26:43 [error] 3291#0: *18 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: $
2018/09/14 15:27:52 [error] 3291#0: *18 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: $


I've tried the workaround documented here but this does not resolve the issue.
https://www.scalescale.com/tips/nginx/5 … ng-nginx/#

----

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

2

Re: iRedAdmin and NGINX - 502 Bad Gateway

Is it possible that a recent update is the source of the issue? I setup a server earlier this week and didn't experience this issue. Everything that I'm finding is indicating it's a nginx time out issue, but none of the resolutions are working.

3

Re: iRedAdmin and NGINX - 502 Bad Gateway

Probably this - https://forum.iredmail.org/topic10132-i … quest.html

4

Re: iRedAdmin and NGINX - 502 Bad Gateway


I tried that and also this https://www.scalescale.com/tips/nginx/5 … ng-nginx/# but nothing is working. I installed a brand new server in a different location and am experiencing the same result. Is there an issue with the installer or a recent update within CentOS? Very strange that it's just started happening.

Any help anyone can provide would be very helpful. I've checked the logs and service's status and nothing is showing as failed.

5

Re: iRedAdmin and NGINX - 502 Bad Gateway

I have the same problem!

2018/09/16 11:50:08 [error] 2992#0: *1149 upstream prematurely closed connection while reading response header from upstream, client: 192.168.88.254, server: _, request: "GET /iredadmin/ HTTP/1.1", upstream: "uwsgi://unix:/run/uwsgi/iredadmin.socket:", host: "192.168.88.244"

6

Re: iRedAdmin and NGINX - 502 Bad Gateway

i have the same error i installed without any error mail working but i cannot access iredadmin with error 502 Bad Gateway
,
[error] 537#0: *43 upstream prematurely closed connection while reading response header from upstream

7

Re: iRedAdmin and NGINX - 502 Bad Gateway

Dear all,

Please try to restart 'uwsgi' service first, then restart 'mlmmjadmin' service.
Does this fix the issue?

8

Re: iRedAdmin and NGINX - 502 Bad Gateway

NOOOOOOO!
502 Bad Gateway    nginx

9

Re: iRedAdmin and NGINX - 502 Bad Gateway

- Bug confirmed: Package "uwsgi-plugin-python" was renamed to "uwsgi-plugin-python2" in RedHat/CentOS yum repo.
- How to fix it: Install package 'uwsgi-plugin-python2' manually, then restart uwsgi service:

yum -y install uwsgi-plugin-python2
service uwsgi restart

That's all.

- iRedMail-0.9.8 has been repacked with this fix.

10

Re: iRedAdmin and NGINX - 502 Bad Gateway

thanks, helped!

11

Re: iRedAdmin and NGINX - 502 Bad Gateway

I've confirmed that this has worked for me as well.