9

A few weeks ago I configured an ec2 server on AWS and database is on RDS and I use nginx as web server. When i reboot server from the AWS console my nginx wont restart automatically. I did this using service nginx start command.

Is there any way to configure nginx server, So it restarted when i reboot my ec2 instance

rash111
  • 1,307
  • 4
  • 19
  • 35

1 Answers1

23

You may configure nginx to start automatically on system boot using below command.

 #chkconfig nginx on

Once you run above command, nginx will be always started whenever system boots.

You may check , if service is configured to start automaticaly on system boot using below command.

# chkconfig nginx --list

You may disable service auto start using below command

# chkconfig nginx off
Shubhangi
  • 2,229
  • 2
  • 14
  • 14