Hi,<div><br></div><div>I&#39;m trying to send a POST Subrequest using the same request_body as the Parent Request.</div><div>The subrequest is sent first, and once it has been finalized the parent request goes through.</div>

<div>(this is inspired on Maxim&#39;s ngx_http_auth_request_module)</div><div><br></div><div>It works almost fine, but if I try to make this subrequest to a location containing a proxy_pass, I get some weird behavior. (The connection takes forever to terminate).</div>

<div><br></div><div>My guess is that the request_body gets read by the upstream, and discarded. When the parent request goes through, that data is not available anymore.</div><div>If I create a dummy request_body for the subrequest with temporary buffers, it seems to work fine.</div>

<div><br></div><div>I think I might be able to get around this by reading first the original request_body using ngx_http_read_client_request_body(), </div><div>and then copying the content of r-&gt;request_body to temporary buffers in my subrequest.</div>

<div><br></div><div>But I&#39;m not sure that would be the best way to solve this problem.</div><div><br></div><div>Any ideas ?</div><div><br></div><div>Thank you,</div><div><br></div><div>Matthieu.</div><div><br>-- <br>
Matthieu Tourne<br>
<br>
</div>