Knowledge Base Hub

Browse through our helpful how-to guides to get the fastest solutions to your technical issues.

Home  >  Web Hosting FAQ  >  What to Do When the Service Nginx Restart Fails?
Top Scroll

What to Do When the Service Nginx Restart Fails?

 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:

sudo nginx –t

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:

sudo service nginx reload

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:

cat /var/log/nginx/error.log

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

For our Knowledge Base visitors only
Get 10% OFF on Hosting
Special Offer!
30
MINS
59
SECS
Claim the discount before it’s too late. Use the coupon code:
STORYSAVER
Note: Copy the coupon code and apply it on checkout.