当 nginx 启动时,它会创建大小为 0 的日志文件“access.log”。但是里面没有写日志。error.log 工作正常。
nginx.conf:
http {
access_log /usr/local/webserver/nginx/logs/access.log combined;
....
}
日志文件是:
-rw-r--r-- 1 root root 0 Mar 4 00:54 access.log
-rw-r--r-- 1 root root 3903 Mar 4 00:54 error.log
我完全糊涂了。@_@
是权限问题吗?
但是,在 nginx.conf 的后面部分,在 server {} 部分,access_log 有效!为什么 http {} 部分不起作用?