1. 卸载现有Nginx以及配套包:
apt-get remove nginx -y
apt-get autoremove
2. 删除配置目录(在删除前可以备份以备恢复):
cp -r /etc/nginx /home/backup-nginx # Optional, 备份用途
rm -rf /etc/nginx
3. 重新安装Nginx并生成新文件:
apt-get -o DPkg::options::=–force-confmiss –reinstall install nginx -y
4. 重新启动Nginx服务即可
systemctl restart nginx
📮Comments