My module is overriding the rate limiting module status for POST requests.

Maxim Dounin mdounin at mdounin.ru
Sun Dec 4 22:07:55 UTC 2022


Hello!

On Sun, Dec 04, 2022 at 08:32:13PM +0000, Jeremy Cocks via nginx wrote:

> At the moment, no authz is really happening. During this testing I was
> statically setting the advice from the policy server to be 200.
> Setting this in the access phase works fine for me with no random hitches,
> so that's fixed. Thanks.

Note that in an auth module you are not expected to return or set 
200 anywhere.  Instead, you should return NGX_DECLINED, NGX_OK, 
NGX_HTTP_FORBIDDEN, or NGX_HTTP_UNAUTHORIZED.

> For future reference, is there anything to go by which dictates what phase
> a module should be in and its impact?
> Obviously, access is quite self-explanatory and not sure how i missed it ;')

First of all, you may want to read the relevant chapter of the 
development guide:

http://nginx.org/en/docs/dev/development_guide.html#http_phases

It explains what different phases are expected to do, and lists 
various standard modules which work at the relevant phases.

Reading the relevant core code and corresponding standard modules 
might also help.

-- 
Maxim Dounin
http://mdounin.ru/



More information about the nginx mailing list