1.刪除nginx,-purge包括配置文件
sudo apt-get --purge remove nginx
2.移除全部不使用的軟件包
sudo apt-get autoremove
3.羅列出與nginx相關的軟件並刪除
dpkg --get-selections|grep nginx
sudo apt-get --purge remove nginx
sudo apt-get --purge remove nginx-common
sudo apt-get --purge remove nginx-core
4.查看nginx正在運行的進程,如果有就kill掉
ps -ef |grep nginx
sudo kill -9 XXX
5.全局查找與nginx相關的文件
sudo find / -name nginx*
sudo rm -rf file
6.刪除列出的所有文件
sudo rm -rf file
7.重裝nginx
sudo apt-get update
sudo apt-get install nginx
nginx的其他內容
測試nginx配置是否正確
sudo nginx -t
nginx 重啟
sudo service nginx restart