# How to not log Pingdom bots

**URL:** <https://www.ruby-forum.com/t/how-to-not-log-pingdom-bots/245972>\
**Category:** NGINX\
**Created:** [August 7, 2013, 11:29pm UTC](https://www.ruby-forum.com/t/how-to-not-log-pingdom-bots/245972 "2013-08-07T23:29:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [August 7, 2013, 11:29pm UTC](https://www.ruby-forum.com/t/how-to-not-log-pingdom-bots/245972/1 "2013-08-07T23:29:34Z")

</div>

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](http://z-e-r-o.in/$1) permanent;  
}  
server {  
listen 80;  
server\_name z-e-r-o.in [zsoltero.com](http://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:

> **[Nginx Blocking Spoofed Google Bot – KutuKupret](http://www.kutukupret.com/2011/06/01/nginx-blocking-spoofed-google-bot/)**
>
> I've found something interesting in the nginx mailing list today http://forum.nginx.org/read.php?2,202715,202715#msg-202715 . someone asked whether it is possible to block fake user agent such as google bot. sometimes, a lot of bots flood our servers...

> <https://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](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?

Posted at Nginx Forum:

> **[How to not log Pingdom bots](https://forum.nginx.org/read.php?2,241690,241690#msg-241690)**
>
> 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...
