在启动nginx时将server root指定为参数

时间:2015-03-22 08:18:05

标签: nginx

我在Windows上将nginx放入/d/webservers/nginx并将其添加到PATH中。现在我尝试从不同的文件夹运行nginx但是出现以下错误:

nginx: [alert] could not open error log file: CreateFile() "logs/error.log" failed (3: The system cannot find the path specified)

2015/03/22 10:09:25 [emerg] 5516#3056: CreateFile() "C:\Users\username/conf/nginx.conf" failed (3: The system cannot find the path specified)

似乎nginx无法找到服务器根文件夹/d/webservers/nginx,其中存在config和logs文件夹。有没有办法将传递作为参数传递给服务器根文件夹?类似于Apache的事情:httpd -d /d/Webservers/Apache24'

1 个答案:

答案 0 :(得分:1)

nginx -c d:/webservers/nginx/conf/nginx.conf

相关问题