What are the commands for starting and stopping nginx in Linux?

The commands for starting and stopping Nginx in Linux are as follows:

Start Nginx service.

sudo systemctl start nginx

Stop the Nginx service.

sudo systemctl stop nginx

Restart Nginx service.

sudo systemctl restart nginx

Check the status of Nginx service:

sudo systemctl status nginx

Automatically start the Nginx service when booting up.

sudo systemctl enable nginx

Disable auto-start for Nginx service when stopped.

sudo systemctl disable nginx
bannerAds