back to top
HomeTutorialsNginxPopular Nginx Commands (Systemctl & Nginx Commands)

Popular Nginx Commands (Systemctl & Nginx Commands)

How to install Wordops in Ubuntu 24.04 (Noble)

WordOps provide the ability to deploy a blazing fast and secured WordPress with Nginx by...

How to Set Up SSH Keys on Ubuntu

SSH, or secure shell, is an encrypted protocol used to administer and communicate with servers....

How to Set Up UFW Firewall on Ubuntu 24.04...

Ubuntu 24.04 LTS comes with UFW Firewall that protects the server against unauthorized access. This...

Linux Commands Cheat Sheet List

Linux commands may seem intimidating at first glance if you do not use the terminal...

How To Change Timezone in Ubuntu 24.04 with Terminal

Using the correct date and time on your Ubuntu system is essential for tasks and...

Nginx is a powerful server application that routes network traffic. It’s often used as a reverse proxy server but can also be configured as a web server. Therefore there are a few important Nginx commands you should be aware of in order to get familiar with the basics of this web server. These commands are essential when applying new changes or when troubleshooting issues.

Nginx Commands

Reference the following list of popular commands if you ever need a quick reminder on how to use a certain command or what it does.

Status Nginx

You can display the status of the Nginx service by entering the following command in a terminal

sudo systemctl status nginx
Nginx Commands

Start Nginx

sudo systemctl start nginx
sudo /etc/init.d/nginx start

Stop Nginx

Stopping Nginx will kill all system processes quickly. This will terminate Nginx even if there are open connections.

sudo systemctl stop nginx
sudo /etc/init.d/nginx stop

Restart Nginx

Use one of the following commands to run an Nginx restart

sudo systemctl restart nginx
sudo /etc/init.d/nginx restart

Quit Nginx

sudo systemctl quit nginx

Reload Nginx

You can reload Nginx by using one of the following commands

sudo systemctl reload nginx
sudo /etc/init.d/nginx reload

Test Nginx Configuration

This helps prevent any unforeseen errors which can cause your website to gown down.

nginx -t

Check Nginx Version

systemctl -v nginx

LEAVE A REPLY

Please enter your comment!
Please enter your name here