# Proxy\_pass defaulting to http 1.0

**URL:** <https://www.ruby-forum.com/t/proxy-pass-defaulting-to-http-1-0/245533>\
**Category:** NGINX\
**Created:** [June 14, 2013, 4:54pm UTC](https://www.ruby-forum.com/t/proxy-pass-defaulting-to-http-1-0/245533 "2013-06-14T16:54:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [June 14, 2013, 4:54pm UTC](https://www.ruby-forum.com/t/proxy-pass-defaulting-to-http-1-0/245533/1 "2013-06-14T16:54:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ituyen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/5fc32e/32.png) [@ituyen](https://www.ruby-forum.com/u/ituyen)\
**Post date:** [June 16, 2013, 3:49am UTC](https://www.ruby-forum.com/t/proxy-pass-defaulting-to-http-1-0/245533/2 "2013-06-16T03:49:06Z")

</div>

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.

> **[nginx: donation](http://nginx.org/en/donation.html)**
