Restart Nginx in Ubuntu [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 nginxsudo systemctl stop nginxsudo systemctl restart nginx
OR
sudo service nginx startsudo service nginx stopsudo service nginx restart
OR
sudo /etc/init.d/nginx startsudo /etc/init.d/nginx stopsudo /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