disable logging for certain response

Richard Kearsley Richard.Kearsley at m247.com
Mon Jun 11 06:46:30 UTC 2012

I am using nginx lua to return a 302 for certain requests - probably about 50% of total requests

e.g. (lua code)

        if (res.status == ngx.HTTP_MOVED_TEMPORARILY) then
                local loc = res.header["X-Location"]
                if (ngx.var.is_args == '?') then
                        loc = loc .. '?' .. ngx.var.args
                return ngx.redirect(loc)

The other 50% are processed normally and a full reponse is returned

I do not need to log the 302 responses, and indeed it is causing a much waste of processor time when I come to analyse/process the logs (this is 100s of gigabytes of logs per day - so is a HUGE waste)

Is there any way to set a var prior to returning the 302 which will cause nginx not to log it?

Richard Kearsley
Systems Developer | M247 Limited
Internal Dial 2210 | Mobile +44 7970 621236

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120611/3ce61652/attachment.html>

More information about the nginx mailing list