I always wondered why nginx didn't started on boot. Well, it actually did, but too soon. So I needed to change the order. Doing this is not so obvious. That's why I'm posting the solution I found.
The system is Ubuntu 18.04 with Virtualmin and nginx module.
1- First, remove apache to start;
Type in the command line:
sudo update-rc.d -f apache2 remove
2- Change the order of nginx to start; Access /etc/init.d/nginx; or Webmin > System > Bootup and Shutdown -> Select 'nginx' ; Remove the original 2 lines
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
And add this 2 lines
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
That´s it. Now nginx will start and work after a system reboot/shudown.