Nginx 禁用404错误日志记录
在我的配置中,我使用:Nginx 禁用404错误日志记录,nginx,Nginx,在我的配置中,我使用: error_page 404 /switch; 当我浏览到/testABC时,我在日志中看到以下错误: open() "/usr/local/nginx/html/www/testABC" failed (2: No such file or directory) 如何禁用此错误?我目前正在使用404作为站点功能的一部分。如果您不希望在nginx错误日志中显示404错误,log\u not\u found是您要配置的指令 默认情况下,log\u not\u fou
error_page 404 /switch;
当我浏览到/testABC时,我在日志中看到以下错误:
open() "/usr/local/nginx/html/www/testABC" failed (2: No such file or directory)
如何禁用此错误?我目前正在使用404作为站点功能的一部分。如果您不希望在nginx错误日志中显示404错误,
log\u not\u found
是您要配置的指令
默认情况下,log\u not\u found
设置为“on”,它将在主错误日志中报告文件未找到的错误。要关闭这些功能,只需执行以下操作:
log_not_found off;
来源:是否有一个指令只关闭200的日志记录?你是说访问日志?据我所知,那是完全不同的日志。