A more detailed and professional solution and description is provided by Odin in the Knowledge - Base for the described issues:
[Unit]
After=network.target remote-fs.target nss-lookup.target
Well, this issue still exists in Plesk 12.0.18 - very annoying.
Better war for IPv4 only enviromentes, because its update-safe.
- mkdir /etc/systemd/system/nginx.service.d
- create file named start-dep-network.conf or something ends with .conf
- add this lines to the newly created file:
- save and do a systemctl daemon-reloadCode:[Unit] After=network.target remote-fs.target nss-lookup.target
Odin should fix it's unit file for nginx!!!
I've determined the bug causing this and have filed it with Plesk support.
The issue is twofold:
1) If your server is using ONLY IPv4, then you can fix this by editing the following file:
/etc/systemd/system/multi-user.target.wants/nginx.service
Change this:
After=nss-lookup.target remote-fs.target
to
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target
The bug is that Odin has Plesk write out the systemd startup service file without it requiring networking to be online before it can be started. The system boots up, nginx tries to bind to explicit IP addresses which are not up yet, so it fails and doesn't start. You can start it yourself after boot but of course it's down until you do that.
.