Logging empty.gif

I have built a small stand alone nginx server, all it is doing is
serving up one
empty.gif. I want to use this server to get up to the minute logs for my
main
site. Each page on the main site has an image tag for the empty gif on
the
standalone.

However, testing it, when i hit a page with the gif, it doesn’t get
logged on
the server. If i hit reload in my browser, it does get logged, but if i
type in
the url or go to the page thru a link, no log. If i hit the empty gif
directly,
it does get logged,

How can i get it it to log every hit??

Possibly your browser cache?

Add a random query string - empty.gif?jhflksfhsl

That tricks most browsers into thinking it’s a fresh request. That
might help you.

It’s probably being cached. You can either do something like

img src=“1pixel.gif?randomnumber=xxxxxxx” where xxxxxxx changes every
time, or you can try to force some headers in with the 1 pixel gif so
that the browser doesn’t consider the item cacheable, or both.

On Sep 16, 2008, at 3:09 PM, Paul wrote:

the server. If i hit reload in my browser, it does get logged, but
if i type in
the url or go to the page thru a link, no log. If i hit the empty
gif directly,
it does get logged,

How can i get it it to log every hit??

Like this:

location ~ ht.gif$
{
access_log /var/log/ah/hitsummarizer/hit.log hitlog;
expires -1;
empty_gif;
}

assuming you called it ht.gif and wanted it logged to /var/log/ah/
hitsummarizer/hit.log.

you get the idea…