title: Openresty Lua : cannot connect to redis after receiving response from api-server
body: <p>I am making a call limiter based on api key and I am keeping counter of calls in redis where key is my api-key and value is a counter. After threshold or allowed call for that key is reached I throw a message stating your quota reached or something.It works fine and response is also quick, but the problem is I cannot access response status of api-server so even if the response is <strong>500</strong> , the call counter gets increased.
  Now, what I need to do is, increase counter only if I get status code <strong>2.x.x</strong> , but I can only capture response <code>ngx.status</code> in <code>body_filter_by_lua_file</code> but in this directive I cannot make connection to redis or postgres. It throws <code>failed to run body_filter_by_lua*: attempt to yield across C-call boundary</code> error , I can, however connect to redis in <code>content_by_lua_file</code> but cannot access response status. Hope I made it clear.</p>
  <p>PS: I am using latest openresty and lua-resty-redis</p>