Proxy_pass defaulting to http 1.0

Since proxy_pass by default uses HTTP 1.0 shouldn’t it also clear the
Connection header by default?

This causes major problems for the unsuspecting reverse proxy that
encounters a .NET system.net.WebClient request. WebClient automatically
sends Connection: keep-alive even for a HTTP 1.1 request. Some calls to
WebClient#downloadFile will apparently chew up a connection in the
underlying .NET connection pool, and then WebClient will hang waiting
for a connection to free up without issuing the HTTP GET request.

The fix was to do

proxy_set_header Connection ""

For some reason “proxy_http_version 1.1” by itself didn’t do anything to
prevent the random WebClient hangs.

Hello!

On Fri, Jun 14, 2013 at 04:54:26PM +0200, Tu Tr wrote:

Since proxy_pass by default uses HTTP 1.0 shouldn’t it also clear the
Connection header by default?

By default, nginx uses “Connection: close” in upstream requests
for maximum compatibility with various backend servers.

For some reason “proxy_http_version 1.1” by itself didn’t do anything to
prevent the random WebClient hangs.

From your description it isn’t clear what goes wrong and what
fixes the problem. You may want to investigate further.


Maxim D.
http://nginx.org/en/donation.html