During CentOS 7 system boot nginx start fails with the following error:
2014/08/04 17:27:34 [emerg] 790#0: bind() to a.b.c.d:443 failed (99: Cannot assign requested address)
I suspect this is happening due to the network interfaces not being up yet before attempting to bind to that IP address for serving a vhost over SSL.
My guess is I need to specify the network.service as a requirement for the nginx.service, but I can't find the network service in /etc/systemd/ at all.
How can I configure the service order or dependencies in systemd?
Best Answer
You need, at minimum,
After=network.target
in the[Unit]
section of your unit file, to ensure that the network is up before starting nginx. I have no idea why your unit file doesn't have it.Here is a complete example from my handy Fedora system, as shipped by Fedora: