502 Bad Gateway errors: Init file not created for recent virtual servers (Nginx PHP fcgi)

When creating Nginx virtual servers with Virtualmin, until recently it worked well (last time 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 didn’t create the init file at /etc/init.d/. Therefore, after running well for a while, then -when rebooting the Ubuntu server- while the old Nginx virtual servers are 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 server got a recent Webmin update from 1.801 to 1.810 on 2016-08-09, but I don’t know if this is related. Webmin > System > Software Packages says the installed version of the Webmin module for Nginx Webserver is: webmin-virtualmin-nginx 1.8.

Please, is there a way so that Virtualmin sets the init files when creating virtual servers (Nginx PHP fcgi), like it did before? I can test possible solutions on a local dev server. Thank you very much for your help.

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.

Since this now seems a bug, i’ve moved the data above to an issue (bug report), where we can try to help solving it by testing, etc.

Thank goodness you posted this!!! Rebooted and had the exact same issue, started to see missing fcgi files and thought they had been deleted. I have been debugging for about 4 hours. Thank you VERY much JG, I have also posted on the bugs, hopefully we both get a resolution soon.

Was this every solved. Just created my first new server in a long time and I’m missing the /etc/init.d/php-fcgi-example-com file also. Were you able to workaround this by copying one of the other init files and just replacing the details for the new server?

kfawcett, that bug was fixed in October with Webmin 1.820.