【发布时间】:2022-12-18 12:04:07
【问题描述】:
我想排除所有这些扩展的日志woff, jpg, jpeg, png, gif, ico, css, js, json
在default.conf我添加了这些位置规则
location ~* \.(woff|jpg|jpeg|png|gif|ico|css|js|json)$ {
access_log off;
}
除了json,所有扩展都被排除在日志之外
我试过这样的单独规则
location ~* \.(json)$ {
access_log off;
}
或者
location ~ \.json$ {
access_log off;
}
无论如何我仍然可以在日志中看到 json 文件
在同一个 default.conf 中,我有另一个 json 扩展规则
location ~* \.(json)$ {
add_header Cache-Control "must-revalidate";
}
这可能是问题吗? 知道如何解决吗?
【问题讨论】:
标签: nginx nginx-config