windows 下Nginx 入门

验证配置是否正确: nginx -t

查看Nginx的版本号:nginx -V

启动Nginx:start nginx

快速停止或关闭Nginx:nginx -s stop

正常停止或关闭Nginx:nginx -s quit

配置文件修改重装载命令:nginx -s reload

D:\server\nginx-1.16.0>nginx -t
nginx: the configuration file D:\server\nginx-1.16.0/conf/nginx.conf syntax is ok
nginx: configuration file D:\server\nginx-1.16.0/conf/nginx.conf test is successful

如果Nginx 启不来,80端口被占用 ,可以尝试把端口号 改一下。

以下是错误 :

nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)
2019/07/23 01:26:43 [emerg] 6412#2012: CreateFile() "C:\Users\Administrator/conf/nginx.conf" failed (3: The system cannot find the path specified)
nginx: configuration file C:\Users\Administrator/conf/nginx.conf test failed

解决方法见上。

猜你喜欢

转载自www.cnblogs.com/laopo/p/11229416.html