Lua would be a way to go, ea. https://github.com/fanhattan/lua-resty-rate-limit Posted at Nginx Forum: http://forum.nginx.org/read.php?2,257905,257965#msg-257965