Question about Connection: close and proxy_pass
dave at cheney.net
Thu Sep 4 06:58:25 MSD 2008
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
nginx -> wandisco
GET /svn/private/ HTTP/1.0
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:184.108.40.206)
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
Last-Modified: Thu, 04 Sep 2008 01:46:09 GMT
Content-Type: text/html; charset=UTF-8
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/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.
More information about the nginx