如何更改nginx temp&log文件夹或完全禁用日志logging

我正在windows 7下运行nginx 1.3.5,我需要直接从只读介质(CD或DVD)执行nginx,但是当我想运行它时,会失败并显示以下错误:

nginx: [alert] could not open error log file: CreateFile() "logs/error.log" fail ed (5: Access is denied) 2012/08/28 13:52:46 [emerg] 5604#2864: CreateDirectory() "J:\nginx-1.3.5/temp/client_body_temp" failed (5: Access is denied) 

其中J是我的CD-ROM驱动器号。
我已经改变nginx.conf完全禁用日志logging,但似乎仍然会尝试在'/ logs'文件夹中创build一个名为'error.log'的文件,并在启动时在'/ temp'文件夹中创build一些额外的临时内容,我想将“日志”和“临时”目录path更改为Windows临时文件夹(%temp%),但我没有任何想法,我该怎么做。
另外我想知道为什么nginx仍然创build“日志/ error.log”后禁用错误日志logging?

http://nginx.org/en/docs/http/ngx_http_log_module.html列出了控制日志logging的指令,具体来说你有以下2个:

 syntax: access_log path [format [buffer=size]]; access_log off; default: access_log logs/access.log combined; context: http, server, location, if in location, limit_except 

 syntax: error_log file | stderr [debug | info | notice | warn | error | crit | alert | emerg]; default: error_log logs/error.log error; context: main, http, server, location 

所以虽然你可以完全禁用access_log,但对于error_log来说,这似乎并不正确。 尽pipe如此,你仍然可以通过添加以下内容到你的nginxconfiguration来达到你想要的效果;

 error_log /dev/null emerg; #redirect the logging we can't shut off to a black hole; acces_log off; #disable acces log 

更新:只注意到Windows标记,看到这个问题的Windows / dev / null等效

据我所知,你可以禁用访问日志,但不是错误的。 Nginx正在尝试将消息创build/写入位于CD / DVD上的日志文件中。 尝试将日志目录设置为HD分区,比如C:或D: