There is a bug on systemd script Virtualmin creates for domains. After setting up server with Virtualmin and nginx, all sites go down with error 502 Bad Gateway after a reboot. Everything works fine until the reboot.
After researching I found that it is an error with startup scripts Virtualmin creates inside /lib/systemd/system/ directory. The error is in the line 6 of each file.
ExecStop=su user -c kill\ \`cat\ \/var\/php\-nginx\/160827070023515\.php\.pid\` ; sleep 1
This needs to be changed to
ExecStop=/bin/sh -c 'su user -c kill\ \`cat\ \/var\/php\-nginx\/160827070023515\.php\.pid\` ; sleep 1'
for sites to work again. I think this is something that need to be corrected on the next release. I've posted detailed information and temporary workaround for this on my blog post https://vpsfix.com/13883/nginx-executable-path-is-not-absolute/