Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nginx] Don't log commonly missing files #132

Closed
aitte opened this issue Feb 24, 2013 · 1 comment
Closed

[nginx] Don't log commonly missing files #132

aitte opened this issue Feb 24, 2013 · 1 comment
Labels

Comments

@aitte
Copy link
Contributor

aitte commented Feb 24, 2013

This concludes my nginx issue submissions. ;-)

Here's a suggestion for a new config file addition. One that I use myself on all my sites:

dont-log-common-404.conf:

# Avoids filling up the error logs with commonly requested files.
# Note that if you have a custom 404 page, the request may be logged anyway.
location = /robots.txt { log_not_found off; }
location = /favicon.ico { log_not_found off; }
location = /apple-touch-icon.png { log_not_found off; }
location = /apple-touch-icon-precomposed.png { log_not_found off; }

Prevents the error.log file from filling up with missing robots.txt, favicon.ico, and apple iOS icon requests, and makes sure that it's actually filled with real stuff that matters, such as true errors.

Without this file, the error logs become unusable, since every client in the world requests at least one of these files, sometimes multiple, and most sites lack all or some of these non-critical files.

@aitte aitte closed this as completed Feb 24, 2013
@aitte
Copy link
Contributor Author

aitte commented Feb 24, 2013

This and many other issues were fixed in the latest pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant