Systemctl Start Nginx command unable to start the serviceI tried to setup a Centos machine (tried 7.0 Core and 7.2 Core). After the OS has been installed performed
yum install epel-release and yum install nginx
I can see that the default path of the nginx.conf is under
/etc/nginx/nginx.conf
Tried to modify the path by removing the original path (/etc/nginx/nginx.conf) to a new path (/usr/local/nginx/config/nginx.conf) but after modifying the path, the service turned to &quot;Failed&quot; (code=exited, status=1/FAILURE) in red font color.
What I did was revert back to the original path (/etc/nginx/nginx.conf) and directly modified the nginx.conf
vi /etc/nginx.nginx.conf
tested the nginx by typing in: nginx -t, both ok and successful but this time around the service still showed up the same error message.
Tried to make a some research and all pointing out to a script or service but I'm pretty sure after testing the nginx -t, it should work now. No idea if there are other factors for this service to run.
Thanks
Jeffhttps://forum.nginx.org/read.php?9,269671,269671#msg-269671
Sun, 15 Sep 2019 06:42:01 -0400Phorum 5.2.16https://forum.nginx.org/read.php?9,269671,270519#msg-270519Re: Systemctl Start Nginx command unable to start the servicehttps://forum.nginx.org/read.php?9,269671,270519#msg-270519
Can you start the service subsequently with e.g. sudo systemctl start nginx

If so, systemctl is trying to start nginx initially before all its prerequisites are ready (don't know what exactly).

Insert

ExecStartPre=/usr/bin/sleep 20

before

ExecStartPre=/usr/sbin/nginx -t -c /etc/nginx/nginx.conf

in

/lib/systemd/system/nginx.service

NB you may need to redo this after some yum updates...]]>cryogenyxMigration from Other ServersMon, 24 Oct 2016 12:17:59 -0400https://forum.nginx.org/read.php?9,269671,269671#msg-269671Systemctl Start Nginx command unable to start the servicehttps://forum.nginx.org/read.php?9,269671,269671#msg-269671
yum install epel-release and yum install nginx

I can see that the default path of the nginx.conf is under

/etc/nginx/nginx.conf

Tried to modify the path by removing the original path (/etc/nginx/nginx.conf) to a new path (/usr/local/nginx/config/nginx.conf) but after modifying the path, the service turned to "Failed" (code=exited, status=1/FAILURE) in red font color.

What I did was revert back to the original path (/etc/nginx/nginx.conf) and directly modified the nginx.conf

vi /etc/nginx.nginx.conf

tested the nginx by typing in: nginx -t, both ok and successful but this time around the service still showed up the same error message.

Tried to make a some research and all pointing out to a script or service but I'm pretty sure after testing the nginx -t, it should work now. No idea if there are other factors for this service to run.