1

Topic: 502 Bad Gateway after Drupal installation

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.2.0
- Deployed with iRedMail Easy or the downloadable installer? - downloadable installe
- Linux/BSD distribution name and version: Ubuntu 18.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hi,

I was able to access mail.domain.com/mail fine before I installed a Drupal app on my server. Now I get 502 Bad Gateway when I try to browse to the roundcubemail web client. The email server is running fine though and I can send and receive emails. Funny enough I can still browse to the iredadmin panel on mail.domain.com/iredadmin.

The Nginx error log outputs:

[error] 4009#4009: *33 connect() failed (111: Connection refused) while connecting to upstream, client: 100.100.100.100, server: _, request: "GET /mail/ HTTP/2.0", upstreapstream: "fastcgi://127.0.0.1:9999", host: "mail.domain.com"

Any ideas what has been corrupted by Drupal?

Thanks,
Petar

----

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

2

Re: 502 Bad Gateway after Drupal installation

Is php-fpm service still running?

3 (edited by georgiev 2020-05-14 16:28:44)

Re: 502 Bad Gateway after Drupal installation

ZhangHuangbin wrote:

Is php-fpm service still running?

Hi Zhang,

Yes, it's running
( look at the attached photo for a reference )

Post's attachments

Screenshot_2020-05-14_09-27-14.png
Screenshot_2020-05-14_09-27-14.png 37.66 kb, 1 downloads since 2020-05-14 

You don't have the permssions to download the attachments of this post.

4

Re: 502 Bad Gateway after Drupal installation

I've just noticed that I don't see any log records in the php-fpm.log when I try to browse to mail.domain.com/mail

5

Re: 502 Bad Gateway after Drupal installation

Hi Zhang,

Do you think the php-fpm config for Roundcube is messed up?

6

Re: 502 Bad Gateway after Drupal installation

Is your php-fpm running on port 9999?

7

Re: 502 Bad Gateway after Drupal installation

ZhangHuangbin wrote:

Is your php-fpm running on port 9999?

This is in /etc/nginx/conf-enabled/php_fpm.conf

And this is the output of ps aux | grep php-fpm

Post's attachments

Screenshot_2020-05-16_17-26-33.png
Screenshot_2020-05-16_17-26-33.png 9.92 kb, file has never been downloaded. 

Screenshot_2020-05-16_17-29-49.png 53.45 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

8

Re: 502 Bad Gateway after Drupal installation

Check the port number defined in /etc/php/7.2/fpm/pool.d/www.conf.

9

Re: 502 Bad Gateway after Drupal installation

Hi Zhang,

You pointed me to the right direction!
The problem was in the fastcgi_php.tmpl where the fastcgi_pass was set to php_workers instead of the socket location.

Thank you very much for your help!

You are a legend.

10

Re: 502 Bad Gateway after Drupal installation

georgiev wrote:

The problem was in the fastcgi_php.tmpl where the fastcgi_pass was set to php_workers instead of the socket location.

You should update /etc/nginx/conf-enabled/php_fpm.conf instead to use socket. iRedMail uses inet and port 9999 by default.