Check for updates
sudo apt-get update
Upgrade packages and intelligently upgrade dependencies
sudo apt-get dist-upgrade
Restart the server
sudo shutdown -r now
Test nginx configuration
sudo nginx -t
Restart nginx
sudo service nginx restart
sudo apt-get update
sudo apt-get dist-upgrade
sudo shutdown -r now
sudo nginx -t
sudo service nginx restart