windows 下运行 nginx
  1. 下载 nginx http://nginx-win.ecsds.eu/

  2. 配置 nginx.conf

  3. 使用三方工具配置 windows 服务 , 这里使用 winsw.exe https://github.com/winsw/winsw

  4. 将 winsw.exe 重命名为 nginx-service.exe

  5. 创建配置文件 nginx-service.xml

  6. 设置 xml

    <service>
    <id>nginx</id>
    <name>nginx</name>
    <description>nginx</description>
    <executable>D:/nginx/nginx.exe</executable>
    <stopexecutable>D:/nginx/nginx.exe -s quit</stopexecutable>
    <stopparentprocessfirst>true</stopparentprocessfirst>
    <depend></depend>
    <logpath>D:/nginx/logs</logpath>
    <log mode="roll-by-time">
    <pattern>yyyyMMdd</pattern>
    </log>
    </service>
  7. 使用 .\nginx-service.exe -h 查看操作命令

  8. 安装 服务、启用 服务

上一篇
下一篇