<font color="#333399"><font><a href="http://wiki.nginx.org/HttpCoreModule#error_page">The documentation</a> also says that if you don't want to redirect to another page, you can use a named redirection :<br>location / {<br>
error_page 404 @404;<br>}<br> <br>location @404 {<br> access_log /path/to/log;<br>}<br><br>The wiki syntax seems to be wrong though, since it is using brackets and not braces.</font></font><br clear="all"><font size="1"><span style="color:rgb(102,102,102)">---<br>
</span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font><br>
<br><br><div class="gmail_quote">On Tue, Jun 12, 2012 at 4:08 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello!<br>
<br>
On Sun, Jun 10, 2012 at 01:40:12PM -0400, karlseguin wrote:<br>
<br>
> I was interested in having nginx log 404s to their own file.<br>
> Essentially, i _hate_ 404s, so I like to parse access logs find and<br>
> report all 404s. However, as-is, parsing large access logs can be quite<br>
> inefficient since 404s represent such a small % of the entire file. I<br>
> was thinking nginx could filter it out at write-time:<br>
><br>
> access_log not_found.log combined buffer=16K 404;<br>
><br>
><br>
> Apologies for the lameness of the code, but this is what I came up<br>
> with:<br>
> <a href="https://gist.github.com/2906701" target="_blank">https://gist.github.com/2906701</a><br>
><br>
> I certainly don't recommend anyone uses it, I'm mostly just looking for<br>
> feedback. Is this better off in its own module? (there's so much code in<br>
> the http_log_module that I want to leverage though). There's much more<br>
> filtering that could go on that perhaps a new directive is a better<br>
> approach:<br>
><br>
> access_log_filter $status /(40\d)/<br>
> access_log_filter $method GET<br>
><br>
> (which is certainly beyond my capabilities).<br>
><br>
> Thoughts?<br>
<br>
error_page 404 /404.html;<br>
<br>
location = /404.html {<br>
access_log /path/to/log;<br>
}<br>
<br>
Maxim Dounin<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br>