How is the issue with Nginx not starting on boot not fixed yet?
At least this “quick fix” can be added? if the issue is that it is trying to start before network is available. (as that seems to fix it)
in /lib/systemd/system/nginx.service
Change After=network.target to After=network-online.target
So people don’t need to remember to do that manually every time if they did not “fix it” by them self already.
We don’t generally modify upstream packages. The nginx package is provided by Ubuntu. And, it’s a problem that is specific to some network configurations (it is still not clear to me what makes it happen, but it doesn’t happen on my test system). So, if there isn’t already a bug filed with the Ubuntu folks, there probably should be.
If you’re modifying a service file like this, you should first copy it to /etc/systemd/system/nginx.service and modify it there, so it won’t be overwritten on updates to the nginx package.
I note the older ticket indicates Fedora/RHEL have “fixed” this problem, but on my EL systems, the systemd unit also has After=network.target and not After=network-online.target. I’m not sure what they’re doing differently, if it does, in fact, behave differently in whatever circumstance cause the problem (but we’ve never had a report of a problem on any of the EL distros, that I’m aware of, so I’m inclined to think it doesn’t happen there).
But, the consensus across all distros we support seems to be that network.target is the right thing.
I don’t know what the right thing for us to do would be, but mucking about with upstream packaged systemd unit files continues to feel quite wrong.