proxy module handling early responses

Frank Liu gfrankliu at gmail.com
Wed Dec 18 18:09:56 UTC 2019


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.

On Wed, Dec 18, 2019 at 7:22 AM Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Tue, Dec 17, 2019 at 06:37:58PM -0800, Frank Liu wrote:
>
> > When using nginx as a reverse proxy, in case of a large POST payload,
> what
> > does nginx do when upstream server sends response before nginx finishes
> > posting the full payload?
> >
> > One use case is upstream enforces some payload limit and sends a HTTP/413
> > response when the payload read reaches certain limit. Will nginx catch
> this
> > error, stop sending further, and return the 413 to client?
>
> Exactly.
>
> --
> Maxim Dounin
> http://mdounin.ru/
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20191218/946ddf87/attachment.htm>


More information about the nginx mailing list