Alternative to propagate_connection_close
Shawn J. Goff
shawgoff at amazon.com
Tue Mar 3 21:28:36 UTC 2015
I wrote the propagate_connection_close patch previously and Maxim had
concerns that there is no way to close the downstream connection without
also closing the upstream connection, which isn't ideal. I'll have time
to do more work on it, so I'd like to know if this suggestion is worth
implementing. If this suggestion is palatable, I'll make a more formal
definition and coordinate with HAProxy and possibly other projects.
The quick background is that a proxy server is frequently used just for
HTTPS termination, with the plaintext request being forwarded to a port
on the localhost where an upstream server is listening. With this setup,
when the upstream issues a "Connection: close", only the connection to
the local proxy is closed; this is not useful. There should be a way to
treat the proxy as part of the same service and ask it to close the
downstream connection.
I would like to introduce two new headers, Close-Before and Close-After.
The Connection header can reference either of those headers. Both
headers take a comma-delimited list of node-identifiers [1]. If the
Close-Before header is present and the next hop is a host in the
associated node-identifiers list, the Connection" header will be set to
"close", the underlying connection will be closed, and the Close-Before
header is removed. The Close-After header is similar except the
condition is when the current host is in the list.
Example:
Connection: Close-After
Close-After: 127.0.0.1
[1] node-identifiers: http://tools.ietf.org/html/rfc7239#section-6
More information about the nginx-devel
mailing list