Hello!
On Mon, Mar 4, 2013 at 12:00 PM, Ron Gomes wrote:
> The HttpLuaModule documentation distinguishes, but does not precisely
> define, the core constants ngx.OK, ngx.ERROR, ngx.AGAIN, ngx.DONE, and
> ngx.DECLINED.
>
Basically you should only use ngx.OK and ngx.ERROR, as per the documentation.
The semantics of other constants is not documented by intention.
ngx.exit(ngx.DECLINED) is meaningful in access_by_lua, though. See the
corresponding test cases in ngx_lua's test suite (TEST 5 and TEST 6):
https://github.com/chaoslawful/lua-nginx-module/blob/master/t/024-access/satisfy.t#L102
I think we should document this bit in the documentation :)
> Can someone please clarify the distinction? When, for example, might I want
> to return ngx.DECLINED (rather than ngx.OK) from a rewrite hander? How does
> the behavior differ?
>
No.
It's actually not documented, so the behaviour is undefined, officially :)
Best regards,
-agentzh