In this tutorial, I am going to share the how to start/stop Nginx server. Below are the terminal commands to stop and start the Nginx server.
NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. NGINX is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.
Stopping the server:
sudo systemctl stop nginx
Starting the server:
sudo systemctl start nginx
Check the Nginx server status:
sudo systemctl status nginx
The same commands can be used to start / stop / restart the nginx server on a Ubuntu Linux:
1 2 3 |
sudo service nginx start sudo service nginx stop sudo service nginx restart |
Use the following command to test the Nginx configuration for any syntax or system errors:
1 |
sudo nginx -t |
Output:
1 2 |
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful |
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.