How to reject favicon.ico files directly by nginx

this is an online tutorial, set up or no effect

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

nginx will still report an error

2018/04/03 00:00:13 [error] 71-sharp71: *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:
-sharp0 /app/src/public/index.php(6): Yaf_Application->run()
-sharp1 {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/"
Mar.01,2021

the error report is / app/src/Application/controllers/Favicon.ico.php , which is Favicon.ico.php,. Your rules for favicon.ico should not take effect, so it is recommended that you first check whether there is any problem with php redirection


    location = /favicon.ico {
        return 404;
        expires 30d;
        log_not_found off;
        access_log off;
    }
.
Menu