If you close the log of a url directory under nginx
黄舟
黄舟 2017-05-16 17:27:20
0
1
450

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;
}

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
黄舟

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template