How to restart Nginx in Ubuntu or other linux servers [closed]

The nginx web server can be restarted using any one of the following command line syntax. Use systemctl on systemd based version such as Ubuntu Linux 16.04LTS and above:

sudo systemctl restart nginx

OR

sudo service nginx restart

OR (older Ubuntu Linux version):

sudo /etc/init.d/nginx restart

The same commands can be used to start / stop / restart the nginx server on a Red Hat 7 versions:

sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx

OR

sudo service nginx start
sudo service nginx stop
sudo service nginx restart

OR

sudo /etc/init.d/nginx start
sudo /etc/init.d/nginx stop
sudo /etc/init.d/nginx restart

To view status of your nginx server, use any one of the following command:

sudo service nginx status

OR

sudo /etc/init.d/nginx status

OR for Red Hat 7, CentOS 7 and higher

sudo systemctl status nginx

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)