InMotion Hosting Support Center

This short tutorial covers a few basic commands or tasks that can be performed with Nginx from the commandline. Understanding the basic commands is the first step to understanding how to manage Nginx on your server. You can invoke the Nginx executable using the -s paramTeter. The correct syntax is as follows:

nginx -s signal

Common Commands

- stop - Shutdown Nginx fast
- quit - Shutdown Nginx gracefully
- restart - Restarts Nginx while also applying any current configurations.
- reload - forces a reload of the configuration file

Stop Command

Let's say we wanted to stop Nginx right away without finishing the current worker processes. We would use the "stop" command like this:

nginx -s stop

Reload Command

Keep in mind, if you edit the configuration file for Nginx it will not be used or applied until the reload command is invoked or you restart Nginx. To force a reload of Nginx, run the command:

nginx -s reload

Once the reload command is ran a signal is sent to the master process. It then checks the syntax of the new configuration file and attempts to apply it. If this is successful, the master process will start new child processes using the new configuration. Old child processes still running will be sent a command to end the current process and restart using the new configuration.

If the new configuration is found to be invalid, the master process will roll back changes and will continue to use the old configuration. This is a great feature as you'll never be able to stop the current configuration and replace it with an invalid one.

Was this article helpful?
Continued Education in Course 101: Getting Started With Nginx
You are viewing Section 2: Basic Nginx Commands
Section 3: Nginx Reverse Proxy

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Post a Comment

Email Address:
Phone Number:

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!