NGINX NOT properly set up with iRedMail installation - 502 bad gateway error

Posted October 17, 2020 1.7k views
NginxEmailDNSLEMPInitial Server Setup

OS: Linux Ubuntu 20.04
Web server: NGINX
Database: MariaDB

The installer ran on the command line

I have already made the necessary configuration prior to the installation:

  • Set DNS records (A & MX records)
  • Set FQDN with setting the ’/etc/hosts’ file as
    MyIPAddress mail

  • Allowed UFW ports 25, 587, 465

  • etc., etc..

Then when I try to go to the login pages for iRedMail & RoundCube, I get nothing but a ‘502 bad gateway’ error page.

I thought that iRedMail says to NOT install anything prior to running their installation. I know that their installation is supposed to be a on 'fresh OS’.

Why doesn’t the installation lead me to a working page? What else could I be missing? Am I still supposed to set up my own NGINX Server Blocks and enable sites on this subdomain?

Any support is appreciated.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi @AaronEsteban1,

In order to get more information about the actual problem, I would suggest checking the Nginx error log, that way you would be able to see what actually is wrong rather than the generic 502 error.

To do that you can run the following command:

  • sudo tail -100 /var/log/nginx/error.log

Also, can you share the installer command that you ran initially?