我在 /etc/nginx/sites-enabled/*.conf 文件中包含以下行,以从访问日志、favicon、php、站点地图消息中删除:
包括 access_log_rules/log_off.conf;
log_off.conf 文件内容:
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~ \.php$ {
access_log off;
log_not_found off;
}
location = /sitemap.xml {
log_not_found off;
access_log off;
}
问题是我无法启动nginx,我遇到以下错误:
nginx:[emerg] /etc/nginx/access_log_rules/log_off.conf:1 中的重复位置“/favicon.ico”
如果我搜索该语句的重复项,则没有。“grep -rnw '/etc/nginx' -e 'favicon.ico'”