Reading request body in PRE_ACCESS phase

Yichun Zhang (agentzh) agentzh at
Fri Aug 29 20:35:28 UTC 2014


On Fri, Aug 29, 2014 at 12:53 AM, Fasih wrote:
> Btw, I think you have to set write_event_handler to empty. Basically,
> if you dont set it, and there is a write_event (while the body is not
> read), nginx would call core_run_phases which you werent expecting.

The ngx_http_read_client_request_body function already sets that
automatically for us :)

Also, even if your phase handler is called prematurely, you can still
guard that with the state recorded in your own "ctx". Remember that
you need to set a flag in "ctx" in your "post_read" callback?


More information about the nginx-devel mailing list