在 Debian 系统下,启动 Nginx 通常使用 systemd 来管理服务。下面是常用操作:
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
nginx -v
或
dpkg -l | grep nginx
如果没有安装,可以先安装:
sudo apt update
sudo apt install nginx
sudo ss -tlnp | grep 80
sudo nginx -t
如果你是在 Docker / WSL / 非 systemd 环境(如某些容器),可以告诉我,我再给你对应的启动方式。