在nginx安装目录下打开命令行
1 开启服务 start nginx.exe
2 检查服务是否开启成功:
tasklist /fi "imagename eq nginx.exe"
出现下图所示,启动成功

其他命令:nginx -s reload :重新加载启动服务;
nginx -s stop :停止服务;
出现错误时,在服务安装目录的log文件

常见错误:
1 [emerg] 22804#20628: invalid number of arguments in "root" directive in D:\Nginx server\nginx-1.13.2/conf/nginx.conf:44

2 [emerg] 8940#8944: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access
这是80端口被占用或者防火墙的原因。
网友评论