How nignx handled the header to the client in this situation
I understand the nginx would proxy the header first and then the body, in
the case the connection with the upstream is broken during the transfer of
body, what status code the client would get? since the nginx would proxy the
200 OK from upstream first to the client, but will nginx send another 5xx
header to the client if the upstream connetction is broken?
Re: How nignx handled the header to the client in this situation
Thanks for the reply!
w.r.t. the "http://nginx.org/r/proxy_buffering", the doc does not mention if
the buffering works for header, body or both, I'm wondering if nginx can
postpone the sending of upstream header in any ways? otherwise the client
will get wrong status code in this case.
It sounds like it should be fairly straightforward to test on your setup,
if you want to convince yourself what it does -- make an upstream that
receives a request, waits 5 second, sends the response header, waits 10
seconds, sends some of the response body, waits 10 seconds, and sends
the rest of the response body.
Then make a request directly to that upstream, and see that you see
something after 5, 15, and 25 seconds.
Then make a request through nginx, and see if you see anything before
25 seconds (all buffered); or see something after 5 seconds (header sent
early) or after 15 (header and start of body sent early).
> I'm wondering if nginx can
> postpone the sending of upstream header in any ways?
Can you show the request that you make and the response that you get
that is not the response that you want?