Knowledge Base
MilesWeb / Web Hosting FAQ

What to Do When the Service Nginx Restart Fails?

Approx. read time : 2 min

In this article, you will learn to find the error when the service Nginx restart fails.

Basically, you get the error “service nginx restart fails” when something goes wrong while you edit the nginx.conf. Nginx doesn’t restart after that.

1. To resolve this error, run the below syntax after each modification is done in your nginx config file:

This command will help you to find any error in config file. If you find any nginx errors, fix them immediately.

2. In case all is working well, execute the below command:

Note:

  • reload – It means your configuration will be reloaded by nginx without restart.
  • restart – It will stop and start the nginx again. Your website will go offline for some seconds.

3. The error log can be checked as below:

In this way, you can resolve the “service nginx restart fails” error.

Avatar
Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.