How to log GoogleBot useragent in its own access log?

Luca De Marinis loop at interact.it
Thu Mar 4 13:14:19 MSK 2010


On Thu, Mar 4, 2010 at 11:05 AM, Luca De Marinis <loop at interact.it> wrote:

> 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.
>
>
Sorry, I guess that redirecting to a virtual host with it's own logging
directive is going to be even simpler, as paths can be the same!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20100304/75d71147/attachment.html>


More information about the nginx mailing list