How to restart nginx?

Solution 1:

The nginx package supplies a /etc/init.d/nginx script that provides the usual start|stop|restart|reload ... functionality.

/etc/init.d/nginx restart

will restart nginx

as will

service nginx restart

Edit

Here is a link to a script you can use as /etc/init.d/nginx.

Solution 2:

http://wiki.nginx.org/CommandLine

inside the links there are some command for start and stop nginx server

for starting nginx:

/usr/bin/nginx

for stoping nginx:

/usr/bin/nginx -s stop

/usr/bin depends on where you install your nginx


Solution 3:

For some reason, on the embedded system I am working on it is:

systemctl restart nginx

Tags:

Nginx

Redhat