How to reinstall Nginx on Ubuntu

1. Backup

sudo tar -czvf ~/nginx.backup.tar.gz /etc/nginx/

2. Uninstall

sudo apt purge nginx

3. Install

sudo apt install nginx

4. Check

sudo systemctl status nginx