Welcome! Log In Create A New Profile

Advanced

Re: How to avoid 404 for images in access log?

Reinis Rozitis
September 22, 2011 12:18PM
> My access log is full of 404 logs for images not found; thus, it is difficult to find real 200 successful visits. The lines
> include
> ... GET /css/img/calendar.png HTTP/1.1" 404 31
> "http://mydomain.com.page.html ...


Depending on if you don't want to log 404 requests at all or just for the images can probably do something like this:


location ~* ^.+\.(jpg|jpeg|gif|png)$ {
error_page 404 @nolog;
}

location @nolog {
access_log off;
}


If you want it for any request just use the error_page without location or even give a different logfile for the 404s.

rr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to avoid 404 for images in access log?

etrader September 22, 2011 11:39AM

Re: How to avoid 404 for images in access log?

Alexandr Gomoliako September 22, 2011 11:46AM

Re: How to avoid 404 for images in access log?

etrader September 22, 2011 11:53AM

Re: How to avoid 404 for images in access log?

Alexandr Gomoliako September 22, 2011 12:04PM

Re: How to avoid 404 for images in access log?

etrader September 22, 2011 12:17PM

Re: How to avoid 404 for images in access log?

Reinis Rozitis September 22, 2011 12:18PM

Re: How to avoid 404 for images in access log?

etrader September 22, 2011 12:54PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 205
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready