1

Topic: Adding additional PHP site results in 502 Bad Gateway

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.8
- Linux/BSD distribution name and version: Ubuntu 18.04 LTS
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- 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'm trying to setup more web sites on the same server where iRedMail is installed. The iRedmail setup is working, Roundcube, iRedAdmin, etc all are functioning without issues.
Adding another domain with a new server block in 00-default.conf or 00-default-ssl.conf is working as long as it is html based. Switching the contents of the same config to PHP and it will result into a 502 Bad Gateway.
Even a simple index.php with <?php phpinfo( ); ?> will fail with a 502 Bad Gateway while replacing the index.php with a simple index.html is not giving any issues. On a default fresh Nginx installation on a server without iRedmail installed the same Nginx sites_available setup with PHP runs without issues.

So what is wrong with a PHP site placed in the root location of the Nginx server?

My goal is to run iRedmail and two or more domains with Wordpress instances on one Ubuntu 18.04 LTS server. But the setup of the installation of 0.9.8 is not allowing any "normal" PHP site configuration.

----

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

2

Re: Adding additional PHP site results in 502 Bad Gateway

Make sure your "server {}" block includes 1 Nginx snippet file, so that it supports php files:

server {
    ...
    include /etc/nginx/templates/php-catchall.tmpl;
}