Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two sites running on two Linode servers.

When I restart server #1, it automatically starts NGINX again right away

When I restart server #2, it does not!

How can I configure my server so that it restarts NGINX when I reboot the server?

Thanks in advance...


share|improve this question

migrated from Jun 13 '11 at 1:15

This question came from our site for professional and enthusiast programmers.

how you have installed nginx? which os? does apache is also installed? – pragnesh Jun 13 '11 at 4:09
Do you use systemd? – Anatoly Aug 6 '15 at 21:49

Put in /etc/rc.local:

/www/nginx/sbin/nginx (or what you path is)
share|improve this answer

If your using ubuntu you can use update-rc.d

update-rc.d nginx enable 2345

or if your using a redhat based system

chkconfig nginx --level 2345 on
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.