Home  >  Q&A  >  body text

If you close the log of a url directory under nginx

The thinkphp framework we are using now uses the index.php file for all requests. Since the business uses some scheduled tasks, there are a lot of requests. It is of little significance to record these requests in the log, so I want to close this request. url directory
http://www.test.com/cron/aaaa
http://www.test.com/cron/bbbb

When I use the following command, I find that 404 is always returned. nginx regards the /cron url directory as the physical /cron directory on the disk, so it cannot find the 404 returned directly, and the website actually uses index. .php?m=index&c=cron&a=aaaa This kind of structure, how should I configure the closing log function under nginx?

location ^~ /cron {
access_log off;
error_log /dev/null;
}

黄舟黄舟2712 days ago425

reply all(1)I'll reply

  • 黄舟

    黄舟2017-05-16 17:29:20

    You have not configured how to handle this path. Try writing if in the original configuration.

    reply
    0
  • Cancelreply