Welcome! Log In Create A New Profile

Advanced

Re: Proxy module buffering and timeouts

Maxim Dounin
September 04, 2015 10:00AM
Hello!

On Fri, Sep 04, 2015 at 08:42:54AM -0400, donatasm wrote:

[...]

> but also i sometimes randomly get partially cut responses:
>
> curl -i http://localhost:7070/demo
>
> HTTP/1.1 200 OK
> Server: nginx/1.9.4
> Date: Fri, 04 Sep 2015 12:24:35 GMT
> Content-Type: text/plain
> Content-Length: 27
> Connection: keep-alive
>
> curl: (18) transfer closed with 27 bytes remaining to read
>
> How this can be fixed?

By fixing your backend to return a full response or not return it
at all.

> Since proxy buffering is on, i expect nginx always
> return either 502 error page on upstream timeout or a response from an
> upstream.

No, this is wrong expectation. Buffering means that nginx will
avoid doing an extra work for partially filled body buffers, and
it will be allowed to buffer parts of a response in the filter
chain. No attempt will be made to obtain a full response and
check it's length (and such a behaviour is not at all possible if
the response is big enough). As long as a response header is
received from an upstream server, it will be passed to the client,
and then nginx will start proxying the response body. An error
can be returned only if the header was not yet passed to the
client.

--
Maxim Dounin
http://nginx.org/

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

Proxy module buffering and timeouts

donatasm September 04, 2015 08:42AM

Re: Proxy module buffering and timeouts

Maxim Dounin September 04, 2015 10:00AM

Re: Proxy module buffering and timeouts

donatasm September 04, 2015 10:28AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 165
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