__utm.gif --- how to redirect request?

Joshua Zhu zhuzhaoyuan at gmail.com
Fri Sep 11 06:11:53 MSD 2009


Hi,

My suggestion:

location = /__utm.gif {
    return 404;
}

or

location = /__utm.gif {
    log_not_found off;
}

On Fri, Sep 11, 2009 at 9:35 AM, Ilan Berkner <iberkner at gmail.com> wrote:
> Thank you so much for the detailed response as well as suggested nginx
> configuration, I will try it.
>
> There's no question that this is a problem with something somewhere and I
> will need to figure out what.  Right now I don't have the bandwidth and b/c
> its clogging up the error log file, I want to clear that up and move on.
>
> I don't think that its happening due to crawlers as the pages that are
> coming up in the log file (referring page) are many and there is no
> pattern.  I've checked many of the referring IP addresses and they are valid
> users of our service.
>
>
>
> On Thu, Sep 10, 2009 at 8:27 PM, Nick Pearson <nick.pearson at gmail.com>
> wrote:
>>
>> These requests could be from crawlers.  A couple ways to tell: (1) are
>> the requests from just a few IPs, or from lots of different IPs?  And
>> (2) do the requests contain all the query string parameters that are
>> sent to Google Analytics?
>>
>> I run several sites, all of which use Google Analytics, but I've never
>> seen this particular request in the logs.  I have seen some others of
>> unused assets that crawlers found in various JavaScript or CSS files.
>> Some crawlers seem to scrape all referenced files for something that
>> looks like a URL and then attempt to access it.  I even get requests
>> for "http://tel:/18002345678" from mobile site pages where I have
>> links like <a href="tel:18002345678">1-800-234-5678</a>.  The crawler
>> doesn't understand, but makes the request anyway.
>>
>> I would definitely figure out why this is happening first, but to
>> answer your question, this should do what you need:
>>
>> location ^~ /__utm.gif {
>>    redirect  ^  http://http://www.google-analytics.com$request_uri;
>> }
>>
>> You'll want to pass the $request_uri, otherwise the request to Google
>> Analytics will be meaningless (because it won't contain any tracking
>> data).
>>
>> By the way, if the traffic is over SSL, be sure to redirect here
>> instead, so as not to cause a security warning in some browsers:
>>
>>    redirect  ^  https://ssl.google-analytics.com$request_uri;
>>
>> Also note that I haven't tested these, but I don't see why they
>> wouldn't work.  However, that being said, I don't know how well
>> browsers respect redirects for image requests.
>>
>>
>> On Thu, Sep 10, 2009 at 6:27 PM, Ilan Berkner <iberkner at gmail.com> wrote:
>> > Hi All,
>> > Simple question, I think.
>> > Our error log is flooded with file not found requests for __utm.gif.
>> >  This
>> > is part of google analytics and for some reason, the requested pages
>> > (some)
>> > are trying to load it locally.
>> > I have yet to figure this problem out in terms of the "why" but for now,
>> > I
>> > want to remove it from my error log.
>> > 2 options:
>> > 1. Put a copy of the file in our root directory which will quiet down
>> > the
>> > error log or
>> > 2. Redirect requests to the file via nginx configuration file, something
>> > like this:
>> > location /__utm.gif {
>> >   [ redirect to: http://www.google-analytics.com/__utm.gif]
>> > }
>> > What would be the correct format for above?
>> > Also, has anyone encountered this issue before?
>> > Thanks
>>
>
>

Regards,

-- 
Joshua Zhu
http://www.zhuzhaoyuan.com





More information about the nginx mailing list