Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: access log ONLY for a specific agent string???

$
0
0
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

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>