proxy_pass defaulting to http 1.0

Maxim Dounin mdounin at mdounin.ru
Sun Jun 16 01:48:17 UTC 2013


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.

> 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.

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

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



More information about the nginx mailing list