nginx启动、停止、重新加载

发布时间 2023-12-16 22:21:14作者: 81

原文:

Windows下Nginx的启动、停止等命令_nginx windows 启动命令-CSDN博客

启动:

start nginx 或nginx.exe           //前一个在后台运行,使用默认配置文件 

nginx.exe -c 配置文件             //指令配置文件 

停止:

nginx -s stop 或nginx -s quit  //这好像停不了

taskkill /f /im /nginx.exe > null    //杀死所有nginx进程

 

重新加载配置:

nginx.exe -s reload  //可以新增监听或删除监听,配置文件中删除的监听重新加载后也会停止监听

 

以下为tcp转发的示例

stream
{
    upstream svr1 { server 127.0.0.1:20007; }
    server { listen 20006; proxy_pass svr1; }

}