Welcome! Log In Create A New Profile

Advanced

How to not log Pingdom bots

August 07, 2013 05:28PM
Hi,

I'm trying to do the following:
I would like to stop logging from Pingdom bots, as a checking every 5 second pollutes the access log and it doesn't have any meaningful value. My problem is that I cannot integrate it into any kind of location block.

I encountered the following errors:
1. map cannot be used here
2. if cannot be used here
3. if needs to return something, while I don't want to modify what to return except I simply want to stop logging.

Here is how I tried:
A sample server conf:

server {
listen 80;
server_name www.z-e-r-o.in;
rewrite ^/(.*) http://z-e-r-o.in/$1 permanent;
}
server {
listen 80;
server_name z-e-r-o.in zsoltero.com;
root /home/zsero/http/hosts/z-e-r-o.in;
error_log /home/zsero/http/logs/z-e-r-o.in.error.log;
access_log /home/zsero/http/logs/z-e-r-o.in.access.log;
index index.html index.php;

location / {
try_files $uri $uri/ /index.php?$args;
}

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/php.d/zsero.conf;

client_max_body_size 200M;
}

And in /etc/nginx/conf.d/*.conf there are 5 standard configurations, one of them being nolog.conf:

location = /robots.txt {
access_log off;
log_not_found off;
}

location = /favicon.ico {
access_log off;
log_not_found off;
}

location ^~ /apple-touch-icon {
access_log off;
log_not_found off;
}

I tried methods from here:
http://www.kutukupret.com/2011/06/01/nginx-blocking-spoofed-google-bot/
http://serverfault.com/questions/414027/how-to-block-nginx-access-log-statements-from-specific-user-agents
http://fralef.me/nginx-hardening-some-good-security-practices.html

But none of them work. One reason is that they are all about returning something, which I do _not_ want to modify, since then Pingdom would stop working. The other reason is that I don't know where to put the map block, since map cannot be used there is shown.

Can you tell me how to integrate non-logging of Pingdom bot into my conf?
Also, does the conf look OK?
Subject Author Posted

How to not log Pingdom bots

zsero August 07, 2013 05:28PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 169
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