Welcome! Log In Create A New Profile

Advanced

Re: Problem with post_action when used with return 202; and POST request

Pyry Hakulinen
August 13, 2011 04:08PM
Howdy,

> No, this is incorrect.  Body should be either read or discarded
> before response could be returned (else communication with clients
> which write body and only then read response will just deadlock).

Ah, indeed, I see what you mean. I didn't see it deadlock, but I
really didn't test it all that much. Thanks for looking.

> (I personally consider post_action to be a dirty hack which should
> be removed entirely, and it's not officially documented on purpose,
> but that's another story.)

Yeah, it looks like it isn't that reliable when used with POST
requests. For example, using this:

location / {
proxy_pass http://some.server;
post_action @post;
}
location @post {
proxy_pass http://some.server;
}

post_action will fail when client request body is buffered to a temp
file. Can be "fixed" by increasing client_body_buffer_size or by
discarding request body in @post location (proxy_pass_request_body
off; proxy_set_header Content-Length 0;).

> In you particular case I would recommend actually using module to
> read body and return 202 response instead of using "return 202".

Thanks, this is probably what we will end up doing.

-Pyry

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Problem with post_action when used with return 202; and POST request

Pyry Hakulinen August 10, 2011 07:24AM

Re: Problem with post_action when used with return 202; and POST request

Maxim Dounin August 10, 2011 07:12PM

Re: Problem with post_action when used with return 202; and POST request

Pyry Hakulinen August 11, 2011 07:40AM

Re: Problem with post_action when used with return 202; and POST request

Maxim Dounin August 12, 2011 03:48AM

Re: Problem with post_action when used with return 202; and POST request

Pyry Hakulinen August 13, 2011 04:08PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 316
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready