<div dir="ltr">Our upstream returns HTTP/413 along with "Connection: close" in the header, then closes the socket. It seems nginx catches the socket close in the middle of sending the large payload. This triggers additional 502 and client gets both 413 and 502 from nginx. <br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 18, 2019 at 7:22 AM Maxim Dounin <<a href="mailto:mdounin@mdounin.ru">mdounin@mdounin.ru</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello!<br>
<br>
On Tue, Dec 17, 2019 at 06:37:58PM -0800, Frank Liu wrote:<br>
<br>
> When using nginx as a reverse proxy, in case of a large POST payload, what<br>
> does nginx do when upstream server sends response before nginx finishes<br>
> posting the full payload?<br>
> <br>
> One use case is upstream enforces some payload limit and sends a HTTP/413<br>
> response when the payload read reaches certain limit. Will nginx catch this<br>
> error, stop sending further, and return the 413 to client?<br>
<br>
Exactly.<br>
<br>
-- <br>
Maxim Dounin<br>
<a href="http://mdounin.ru/" rel="noreferrer" target="_blank">http://mdounin.ru/</a><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div>