在 Debian 下,“卸载 Nginx 的 SSL”通常不是“卸载某个软件”,而是移除 Nginx 的 SSL 配置 / 证书,或彻底卸载 Nginx。下面分情况说明。
如果你只是不再用 HTTPS,但还要保留 Nginx:
sudo nginx -T
查看哪些文件里有:
listen 443 ssl;
ssl_certificate
ssl_certificate_key
一般在:
/etc/nginx/sites-enabled/
/etc/nginx/conf.d/
删除或注释掉:
listen 443 ssl;
ssl_certificate ...
ssl_certificate_key ...
sudo nginx -t
sudo systemctl restart nginx
Nginx 的 SSL 是编译进 Nginx 的,不能单独卸载 SSL 模块。
sudo systemctl stop nginx
sudo systemctl disable nginx
sudo apt remove nginx nginx-common nginx-full
sudo apt purge nginx*
sudo rm -rf /etc/nginx
sudo rm -rf /etc/ssl/certs/你的证书
sudo rm -rf /etc/ssl/private/你的私钥
如果是 certbot:
sudo certbot delete
或手动删:
sudo rm -rf /etc/letsencrypt/live/你的域名
sudo nginx -T | grep ssl
如果你能说明:
我可以给你更精确的命令。