log_not_found
The log_not_found directive controls whether to log requests for missing files.
Description
The log_not_found directive in NGINX is used to specify if the server should log requests for files that do not exist. This directive can be incredibly useful for web administrators as it helps monitor access to non-existent resources on the server, potentially revealing broken links, configuration issues, or attempts to access unauthorized content. It can be activated at the http, server, or location context levels, allowing for flexible and granular logging control.
Config Example
server {
log_not_found on;
}Enabling this directive increases the noise in your logs, potentially making it harder to find useful information.
If you're serving dynamic content, ensure you have proper logic in place to handle 'not found' situations without relying solely on this directive.