Welcome! Log In Create A New Profile

Advanced

Re: Backend responding with 100 Continue results in the actual response being lost

Maxim Dounin
July 23, 2013 07:22AM
Hello!

On Mon, Jul 22, 2013 at 08:20:04PM -0400, rstarkov wrote:

> I'm using nginx as a reverse proxy, configured to use HTTP 1.1 so as to
> support range requests. The server responds to some of the requests with a
> "100 Continue", even if there was no "Expect: 100-continue" in the request.
> The server then proceeds to read the rest of the request and, eventually,
> sends the "200 OK" reponse.
>
> In my testing, in this scenario Nginx will forward the 100 Continue to the
> requesting browser, but the 200 OK response never makes it. It seems to be
> silently dropped. The result is that the browser is stuck waiting for a
> response until the request times out.
>
> Is this expected behaviour? From my reading of the HTTP 1/1 spec, this
> server is not in violation of the spec. I'm using v1.4.2 on Windows.

As of now nginx doesn't know how to handle 1xx informational
responses, and it always removes Expect from a requests sent to
backends due to this. RFC 2616 say:

An origin server SHOULD NOT send a 100 (Continue) response if
the request message does not include an Expect request-header
field with the "100-continue" expectation, and MUST NOT send a
100 (Continue) response if such a request comes from an HTTP/1.0
(or earlier) client.

That is, it's 100 Continue isn't expected to be returned to nginx
from a complaint HTTP/1.1 server even if a request is via
HTTP/1.1.

If your backend server returns 100 Continue for some reason, you
may try switching proxy_http_version back to 1.0 as by default.
Most of HTTP servers are capable of handling Range requests via
HTTP/1.0 as well, you shouldn't need HTTP/1.1 for Range requests
to work.

--
Maxim Dounin
http://nginx.org/en/donation.html

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

Backend responding with 100 Continue results in the actual response being lost

rstarkov July 22, 2013 08:20PM

Re: Backend responding with 100 Continue results in the actual response being lost

Maxim Dounin July 23, 2013 07:22AM

Re: Backend responding with 100 Continue results in the actual response being lost

rstarkov July 23, 2013 07:53AM

Re: Backend responding with 100 Continue results in the actual response being lost

Piotr Sikora July 23, 2013 09:48PM

Re: Backend responding with 100 Continue results in the actual response being lost

Maxim Dounin July 24, 2013 03:34AM

Re: Backend responding with 100 Continue results in the actual response being lost

Piotr Sikora July 24, 2013 03:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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