How to log GoogleBot useragent in its own access log?

Luca De Marinis loop at interact.it
Thu Mar 4 13:05:03 MSK 2010


On Thu, Mar 4, 2010 at 9:22 AM, Phillip Oldham <phill at activityhq.com> wrote:

> On 03/03/2010 22:12, David Taveras wrote:
>
>> Would it be possible to match if the useragent contains this string
>> "+http://www.googlebot.com/bot.html"  and log it in a specific file
>> for googles crawling?
>>
>>
>
> Have you tried just using an if statement? Something like...
>

If the docs are right, this is not going to work. acces_log is only valid
within http, server, location;
rewriting urls for a specific location when the user agent matches, and then
defining a custom log there should work.

Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20100304/a61a7a88/attachment.html>


More information about the nginx mailing list