Setting up and using NGINX with Virtualmin is well supported and dead easy. Instructions are already provided here but in this article we will give you a really quick overview of what needs to be done.
Why would you want to do this?
The reason why it’s better to use NGINX is for performance. NGINX simply outperforms Apache. ‘Nough said.
It’s recommended that you do the NGINX conversion BEFORE you start hosting sites. Although Vander Host have converted existing Apache servers to NGINX after sites were already hosted, this will lead to a lot of configuration file work. It’s possible, but could be a daunting high pressure task if you are hosting many live sites already.
Steps to do the Conversion
Below are the steps outlined if you’re using Ubuntu/Debian or CentOS. Follow the steps for your operating system first, and then do the combined steps.
The Ubuntu/Debian Route
/etc/init.d/apache2 stop ; update-rc.d apache2 remove
apt-get install nginx
apt-get install webmin-virtualmin-nginx webmin-virtualmin-nginx-ssl
The CentOS Route
service httpd stop ; chkconfig httpd off
yum install nginx
yum install wbm-virtualmin-nginx wbm-virtualmin-nginx-ssl
Do these steps in Virtualmin for both Ubuntu/Debian and CentOS.
System Settings->Features and Plugins
"Protected web directories", and
"Nginx SSL website"features, then click “Save”.
Congratulations! You are now serving your sites with at least twice the speed than before.