ECM3 email, web, ftp and
dns server installation on macOS Catalina

Page 1 - Brew, Apache, Mysql, phpMyAdmin
Page 2 - Exim, Dovecot, Spamassassin, Clamav, Roundcube
Page 3 - PowerDNS
Page 4 - Nginx (optional)
Page 5 - PureFTPd and Webalizer (optional)
Page 6 - SSL Certificates using Let'sEncrypt
Upgrades - How to upgrade brew modules


Nginx as a Reverse Proxy for Apache

Using Nginx as the primary frontend webserver can increase performance regardless if you choose to keep Apache running on the system. One of Nginx’s greatest advantage is how well it serves static content. It does so much more efficiently than Apache, and with very little cost to memory or processing. So placing Nginx in front will remove that burdern off Apache, leaving it to concentrate on dynamic request or special scenarios.

Install nginx via brew

brew install nginx

pkg nginx-configs.pkg
EDIT
$ open -e /usr/local/etc/httpd/httpd.conf

Set apache to listen on 8080 and edit the include line for sites as shown.

Listen 127.0.0.1:8080
IncludeOptional /usr/local/etc/httpd/sites/*.conf

$ sudo -s
$ apachectl -k restart
$ nginx

## stop-start-restart nginx
sudo -s
nginx
nginx -s stop
nginx -s quit
nginx -s reload; apachectl -k restart

http://localhost
http://localhost/info.php
http://localhost/mailadmin/
http://localhost/phpmyadmin/
http://localhost/roundcubemail/

EDIT
Apache site config file by replacing all instances of "exemple.com" with your domain name.

$ open -e /usr/local/etc/httpd/sites/example.com.conf

Also edit NGINX site config file by replacing all instances of "exemple.com" with your domain name and drop in your IP instead of '0.0.0.0:80'.

$ open -e /usr/local/etc/nginx/servers/example.com

When you finished editing site config files for both Apache and Nginx with your domain name and IP the same folders will be availabe as shared on the server. Be sure to reload both Apache and Nginx.