Welcome! Log In Create A New Profile

Advanced

Re: either error log empty or access log empty

Francis Daly
March 25, 2012 06:14PM
On Sun, Mar 25, 2012 at 04:20:54PM -0400, zhnupy wrote:

Hi there,

> I have a location definition which turns off the access log,
> but it doesn't suppose to fire every time, just for specific file
> extensions, here is the entire server block:

If you look through the debug log for one request, you'll see exactly
why things happen.

When you request "/notthere.php", it uses the "null" location, and returns
404. Then your error_page directive causes a rewrite to /404.html, which
uses the "extensions" location. That is where the request finishes,
so that is where it is logged. And you have access_log off there.

> for instance, this URL: http://DOMAIN_A/aaaa.txt is not supposed to
> fire that rule, but it does.

It shouldn't match that rule if it doesn't generate a 404.

All 404s will match that rule, because of your error_page configuration.

Maybe you want a separate "location = /404.html{}" block?

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

either error log empty or access log empty

zhnupy March 23, 2012 08:48PM

Re: either error log empty or access log empty

Francis Daly March 24, 2012 08:48AM

Re: either error log empty or access log empty

zhnupy March 25, 2012 04:20PM

Re: either error log empty or access log empty

Francis Daly March 25, 2012 06:14PM

Re: either error log empty or access log empty

zhnupy March 25, 2012 08:38PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 301
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready