使用cmd打开命令窗口:
启动:start nginx 或 nginx.exe
重启:nginx.exe -s reload
停止:nginx.exe -s stop 或 nginx.exe -s quit
注:stop是快速停止nginx,可能并不保存相关信息;quit是完整有序的停止nginx,并保存相关信息。
报错:
- nginx: [error] CreateFile() “D:\nginx-1.15.10/logs/nginx.pid” failed (2: The sys
tem cannot find the file specified)
如果启动成功,在D:\nginx-1.15.10/logs目录下会自动生成nginx.pid文件,该问题说明没有启动成功。 - 2019/04/03 14:20:17 [emerg] 5692#15292: bind() to 0.0.0.0:8080 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)
说明8080端口被占用。