Logging Can';t使用nginx禁用图像记录
我试图在nginx中禁用图像的日志记录,但它似乎不起作用 我正在Windows上运行它,我有以下设置:Logging Can';t使用nginx禁用图像记录,logging,nginx,configuration,config,Logging,Nginx,Configuration,Config,我试图在nginx中禁用图像的日志记录,但它似乎不起作用 我正在Windows上运行它,我有以下设置: http { # directives omitted for brevity log_format upstream_log_format '[$time_local] $status $remote_addr $request $http_referer "$http_user_agent" $upstream_addr $upstream_status $upstr
http {
# directives omitted for brevity
log_format upstream_log_format '[$time_local] $status $remote_addr $request $http_referer "$http_user_agent" $upstream_addr $upstream_status $upstream_response_time $http_x_forwarded_for $cookie_cfid';
access_log C:/Logs/nginx/$host-access.log upstream_log_format;
include site.conf;
# directives omitted for brevity
}
然后在site.conf中
server {
# directives omitted for brevity
location ~ /res/ {
expires 14d;
access_log off;
break;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires 14d;
access_log off;
break;
}
}
但是/res/下的图像和文件仍然被记录。我试着改变顺序并在主文件中移动access_log指令,但这似乎没有什么不同
编辑:
更详细的配置在access\u注销的新指令处可用代码>添加在第3个文件的第30行,即。
有什么想法吗?可能是因为在#指令中为了简洁而省略了一些内容
。没有其他与access#u log相关的内容,而且我知道位置部分是可以找到的,因为expires指令工作正常。access Login没有任何内容。对不起,你是对的。access\u注销的新指令代码>已在添加。是否重新加载/重新启动nginx?