当前位置:首页 > nginx > 正文

nginx 服务重启(windows下nginx重启)

  • nginx
  • 2024-03-20 23:47:53
  • 2753
Nginx 服务重启
要重启 Nginx 服务,需要执行以下几个要素:

1. 停止 Nginx 服务:


- 发送 kill -s QUIT 命令
- 或者使用 systemctl stop nginx

2. 检查 Nginx 进程是否已停止:


- 执行 ps -ef | grep nginx 命令,如果没有输出,表示 Nginx 已停止

3. 启动 Nginx 服务:


- 发送 nginx 命令
- 或者使用 systemctl start nginx

4. 检查 Nginx 进程是否已启动:


- 执行 ps -ef | grep nginx 命令,如果进程正在运行,将有输出
示例:
要重启 Nginx 服务,可以执行以下命令:
sudo systemctl stop nginx
ps -ef | grep nginx
sudo systemctl start nginx
ps -ef | grep nginx