Fix NGINX service DNS resolving startup issue

If, like me, you have trouble to get NGINX to start automatically after a system reboot, here is a simple fix…

In my case, it was systemically due to an impossible DNS resolution. NGINX was not able to resolve some FQDN entries in the configuration file and refused to start.
To fix it, I’ve added an extra dependency in the services.

Go to a terminal session (I use the one integrated with Cockpit  on Fedora Server)

Start the command to edit NGINX service parameters: vi /lib/systemd/system/nginx.service

Add NetworkManager-wait-online.service at the end of [After=] line

This will force NGINX to wait the availability of the network before starting.

You may also like

Leave a comment