Since this has turned to probably be a recent Webmin bug, I'm moving the posted data from the forums to this issue. This has been tested on two different servers (running Ubuntu and Debian), with the same results.
When creating Nginx virtual servers with Virtualmin, until recently it worked well (last time here on 2016-08-07), for example automatically adding an init file such as /etc/init.d/php-fcgi-example-com. This can also be seen at Webmin > System > Bootup and Shutdown.
However, after adding today (2016-08-12) two new virtual servers or domains, in both cases Virtualmin/Webmin didn't create the init file at /etc/init.d/. Therefore, after initially running well for a while, then -when rebooting the Ubuntu server- while the old Nginx virtual servers are still working OK thanks to their init files, the new ones on the same server are not restarted because of the lack of those init files, and just give a 502 Bad Gateway error.
This first server got a recent Webmin update from 1.801 to 1.810. Webmin > System > Software Packages says the installed version of the Virtualmin module for Nginx Webserver is: webmin-virtualmin-nginx 1.8.
After additional testing on a different server (Debian on Linode), this appears to probably be a recent bug, appeared a few days ago in Webmin 1.810 (about 2016-08-09).
The three tests used installations of three Webmin versions on the server, an old one, the recent one, and the current one. The following has happened when creating Nginx virtual servers (in the three cases with the same version of the Virtualmin module, webmin-virtualmin-nginx 1.8) :
- Webmin 1.760 -> The init file for the new Nginx virtual servers (/etc/init.d/php-fcgi-example-com) is automatically created. => OK
- Webmin 1.801 -> The init file for the new Nginx virtual servers is automatically created as well. => OK
- Webmin 1.810 -> The init file for the new Nginx virtual servers is not created. => Probably a very recent bug (about 2016-08-09).
The new virtual servers work well at first. This bug is only noticed after rebooting the server, when Nginx is restarted for the old virtual servers but not for the new ones, and the users get the 502 Bad Gateway errors for the new virtual servers.
If you have an idea for Virtualmin setting the init files when creating virtual servers (Nginx PHP fcgi), like it did before Webmin 1.810, I can help testing possible solutions on a local dev server. Thank you very much.