Welcome! Log In Create A New Profile

Advanced

Can I log HTTP 400s to a different log file instead of my default access logs

November 07, 2011 06:21AM
Hello

I'd like to know if its possible for me to log HTTP 400 errors to a different log file. Right now they go in the access log.

To give some background, we've got this problem where if a single resource is requested from chrome, after the resource request is served, a http 400 error is logged in the access logs. This I've understood to be is due to the nature of connections opened by Chrome (2 for every request) and one of the connections not been used before its closed. And nginx reports a 400 in this instance. I've gathered this based on a different forum entry. And when this 400 is logged, the $request_filename is /etc/nginx//html

So I'm looking at any possibility where the 400s can be logged else where. I tried the following with no luck as well;

server {
location / {
if ($request_filename ~* /etc/nginx) {
access_log /someotherlog.log myformat
}
}
}

Any help/advice is much appreciated. Thanks!!

Cheers
-- Imran
Subject Author Posted

Can I log HTTP 400s to a different log file instead of my default access logs

imran November 07, 2011 06:21AM

Re: Can I log HTTP 400s to a different log file instead of my default access logs

imran November 07, 2011 06:38AM

Re: Can I log HTTP 400s to a different log file instead of my default access logs

imran November 07, 2011 08:03AM

Re: Can I log HTTP 400s to a different log file instead of my default access logs

António P. P. Almeida November 07, 2011 06:40AM

Re: Can I log HTTP 400s to a different log file instead of my default access logs

António P. P. Almeida November 07, 2011 07:06AM

Re: Can I log HTTP 400s to a different log file instead of my default access logs

António P. P. Almeida November 07, 2011 09:20AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 46
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready