Question about Connection: close and proxy_pass
Igor Sysoev
is at rambler-co.ru
Thu Sep 4 09:57:09 MSD 2008
On Wed, Sep 03, 2008 at 10:58:25PM -0400, Dave Cheney wrote:
> We're using nginx to proxy between a piece of software that doesn't
> understand our SSL certificate. The diagram looks like this
>
> client --> port:443 --> nginx --> port:8181 --> WANDisco
>
> What we are seeing is nginx is forwarding the request to WANDisco on port
> 8181 with a Connection: close header (as expected). The response is coming
> back from WANDisco with a Connection: close header also, see below for the
> abridged version
>
> nginx -> wandisco
> GET /svn/private/ HTTP/1.0
> Host: 127.0.0.1:8181
> Connection: close
> User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.1)
> Gecko/2008072820 Firefox/3.0.1
>
> wandisco -> nginx
> HTTP/1.1 200 OK
> Date: Thu, 04 Sep 2008 02:14:05 GMT
> Server: Apache/2.2.9 (Debian) DAV/2 SVN/1.4.2 mod_ssl/2.2.9 OpenSSL/0.9.8g
> mod_perl/2.0.4 Perl/v5.10.0
> Last-Modified: Thu, 04 Sep 2008 01:46:09 GMT
> ETag: W/"66230//"
> Accept-Ranges: bytes
> Content-Length: 439
> Connection: close
> Content-Type: text/html; charset=UTF-8
>
> [body skipped]
>
> So the response has a content length and Connection: close. However nginx
> does not consider the response 'done', until wandisco has closed its side
> of the socket.
>
> My reading of RFC 2616 is unclear. Section 14.10
> (http://tools.ietf.org/html/rfc2616#section-14.10) says
>
> "HTTP/1.1 defines the "close" connection option for the sender to
> signal that the connection will be closed after completion of the
> response. For example"
>
> Which appears to indicate that the sender will close the connection, but
> does not use RFC 2119 grammer to indicate that it must.
>
> My question is, is this a bug? Should nginx close its side of the
> connection onces it has read Content-Length: bytes, or should WANDisco
> close its side after sending the response.
I think these are bugs on both side:
1) nginx should send response after it gets CL bytes,
2) while WANDisco should close a connection after it has sent whole response,
if it has said that "Connection: close".
--
Igor Sysoev
http://sysoev.ru/en/
More information about the nginx
mailing list