We currently have a Virtualmin Professional installation with about 165 Websites all running on Apache 2.4.37, PHP 7.2.14, and MariaDB 10.2.22, almost all of which use WordPress to power the Website. In addition, we have the Varnish cache server set up on port 80 and Apache on ports 8080 and 443, and SSL termination is handled by Apache so that Virtualmin can work its existing Let's Encrypt magic and then proxy requests (using Apache) from 443 to Varnish on port 80.
While this setup works, and is split across five different Web servers that all share home directories, Postfix and Dovecot configuration files, and other data, and are sitting behind a single load balancer, memory use on each machine is quite high out of a total of 8 GB RAM per machine, and thus for this reason and several others I am looking into switching from Apache to NGINX.
I have read all over the place on Virtualmin.com that it is recommended to use a fresh, newly-installed copy of Virtualmin when beginning an NGINX journey, but instead I am looking into ways to migrate our existing Websites (both SSL and non-SSL) from Apache to NGINX, preferably the virtual host configuration files and other things used by Apache.
Is this possible and could it perhaps be automated somehow so that we don't have to do this by hand to all 165 sites? At this point I don't care about downtime as we have a separate machine we use for testing and stuff that we could always backup and restore onto our production machines once everything is in place. But I am really looking hard at NGINX, and I've heard Virtualmin's support for it has improved greatly over the years, so I wanted to throw out this migration scenario to see what route I should take moving forward, or if it's even practical/possible given our current setup. Any insight or assistance you could provide would be very much appreciated. Thank you!