Hello Krishna, I have a similar question asking here https://serverfault.com/questions/907860/nginx-limit-request-based-on-response-status-code (no reply yet). I've tried several combinations, but haven't found any working solution yet. It seems that limit was done in "receiving" state of requests only, which mean $status is always null.by viet - Nginx Mailing List - English