Nginx – How to restart nginx

nginxredhat

For me, I run "killall nginx" and start it by "sbin/nginx", anyone has a better restart script?

BTW: I install nginx from source, i do not find 'service nginx' command or /etc/init.d/nginx

Best Answer

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.