Need to identify blocked requests vs other requests

Hello there,

As limit_req returns 503 as well other 503 (service unavailable) native
errors I need a way to differentiate them in the access log.

One easy way would be to be able to set the status limit_req returns,
would
be that possible?

The main reason I’m asking this it’s because we analyze our logs in real
time to alert on certain values, until limit_req I used to hsend alerts
if
more than X 503 status were seen in a time range. However, now I’ve
limit_req legitimate 503 which have nothing to do with the 503 of
Service
unavailable which indeed need to take action.

Any ideas?

Thank you!

Guzmn

Hello!

On Tue, May 15, 2012 at 09:09:11PM -0300, Guzmán Brasó wrote:

more than X 503 status were seen in a time range. However, now I’ve
limit_req legitimate 503 which have nothing to do with the 503 of Service
unavailable which indeed need to take action.

The only cases when nginx generates 503 by itself is limit_req and
limit_conn. Hence simple solution would be to log $upstream_status.

Maxim D.