Skip to content

Commit

Permalink
Don't log healthcheck requests
Browse files Browse the repository at this point in the history
  • Loading branch information
g3rv4 committed Feb 17, 2025
1 parent 15bf199 commit 72edaa3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@ http {
'"$sent_http_location" $status '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;
map $http_user_agent $loggable {
~^FreshpingBot/1\.0 0; # Ignore logging for FreshpingBot/1.0
default 1;
}

access_log /var/log/nginx/access.log main if=$loggable;

sendfile on;

Expand Down

0 comments on commit 72edaa3

Please # to comment.