【问题标题】:Nginx [emerg] duplicate location when there is no other file containing the statementsNginx [emerg] 没有其他文件包含语句时的重复位置
【发布时间】:2018-10-21 08:24:15
【问题描述】:

我已在 /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] 重复位置“/favicon.ico”在 /etc/nginx/access_log_rules/log_off.conf:1

如果我搜索该语句的重复项,则没有。 "grep -rnw '/etc/nginx' -e 'favicon.ico'"

【问题讨论】:

    标签: nginx-config


    【解决方案1】:

    发现问题,conf文件中重复包含以下行:

    include access_log_rules/log_off.conf;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-12-26
      • 1970-01-01
      • 2021-05-21
      • 2015-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-26
      相关资源
      最近更新 更多