nginx如何直接拒绝favicon.ico文件

这是网上的教程,设置了还是没效果

    location = /favicon.ico {
        log_not_found off;
        access_log off;
    }

nginx还是会报错

2018/04/03 00:00:13 [error] 71#71: *16 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Yaf_Exception_LoadFailed_Controller: Failed opening controller script /app/src/Application/controllers/Favicon.ico.php: No such file or directory in /app/src/public/index.php:6
Stack trace:
#0 /app/src/public/index.php(6): Yaf_Application->run()
#1 {main}
  thrown in /app/src/public/index.php on line 6" while reading response header from upstream, client: 172.20.0.1, server: 127.0.0.1, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1:12000", referrer: "http://127.0.0.1:12000/"
动漫人物
浏览 571回答 2
2回答

BIG阳

报错报的是/app/src/Application/controllers/Favicon.ico.php,是Favicon.ico.php,你针对favicon.ico的规则应该没有生效,所以建议你先看看php重定向那里有没有问题

慕的地8271018

location = /favicon.ico { return 404; expires 30d; log_not_found off; access_log off; }
打开App,查看更多内容
随时随地看视频慕课网APP