Ive played around with this:
if ($http_user_agent ~* (bot) ) {
set $crawler 'yes';
}
location / {
if ($crawler = 'yes') {
access_log /var/log/bots.log;
access_log on;
}
}
Just doesnt work. :(
Nothing appears in the log file
if ($http_user_agent ~* (bot) ) {
set $crawler 'yes';
}
location / {
if ($crawler = 'yes') {
access_log /var/log/bots.log;
access_log on;
}
}
Just doesnt work. :(
Nothing appears in the log file