# Nginx support for http/1.1 backend

**URL:** <https://www.ruby-forum.com/t/nginx-support-for-http-1-1-backend/197656>\
**Category:** NGINX\
**Created:** [October 18, 2010, 2:52pm UTC](https://www.ruby-forum.com/t/nginx-support-for-http-1-1-backend/197656 "2010-10-18T14:52:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![okkezSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@okkezSS](https://www.ruby-forum.com/u/okkezSS)\
**Post date:** [October 18, 2010, 2:52pm UTC](https://www.ruby-forum.com/t/nginx-support-for-http-1-1-backend/197656/1 "2010-10-18T14:52:12Z")

</div>

Hello,

I’m using nginx as a reverse proxy, and the backend server  
only supports http/1.1 connections. It silently drops all http/1.0  
connections.

Is there any way to get nginx talk http/1.1 to the backend?  
Any patches I could try?

Thanks!

– Pasi

---

<div class="post-metadata">

**Author:** ![SSPasi\_KS\_rkkS\_inen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e8c25b/32.png) [@SSPasi\_KS\_rkkS\_inen](https://www.ruby-forum.com/u/SSPasi_KS_rkkS_inen)\
**Post date:** [October 19, 2010, 1:42pm UTC](https://www.ruby-forum.com/t/nginx-support-for-http-1-1-backend/197656/2 "2010-10-19T13:42:25Z")

</div>

On Mon, Oct 18, 2010 at 03:50:25PM +0300, Pasi K. wrote:

> Hello,
> 
> I’m using nginx as a reverse proxy, and the backend server  
> only supports http/1.1 connections. It silently drops all http/1.0 connections.
> 
> Is there any way to get nginx talk http/1.1 to the backend?  
> Any patches I could try?

If someone has ideas, let me know..

nginx is great, SSL supported on both frontend and backend,  
so it’s perfect otherwise.. just lacking http/1.1 on the backend 🙂

– Pasi

---

<div class="post-metadata">

**Author:** ![SSPasi\_KS\_rkkS\_inen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e8c25b/32.png) [@SSPasi\_KS\_rkkS\_inen](https://www.ruby-forum.com/u/SSPasi_KS_rkkS_inen)\
**Post date:** [October 19, 2010, 1:56pm UTC](https://www.ruby-forum.com/t/nginx-support-for-http-1-1-backend/197656/3 "2010-10-19T13:56:56Z")

</div>

Seconded. Also the ability to cache gzip is a must

Sent from my iPod

---

<div class="post-metadata">

**Author:** ![SSPasi\_KS\_rkkS\_inen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e8c25b/32.png) [@SSPasi\_KS\_rkkS\_inen](https://www.ruby-forum.com/u/SSPasi_KS_rkkS_inen)\
**Post date:** [October 19, 2010, 3:06pm UTC](https://www.ruby-forum.com/t/nginx-support-for-http-1-1-backend/197656/4 "2010-10-19T15:06:01Z")

</div>

On Tue, Oct 19, 2010 at 6:54 AM, Splitice [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Seconded. Also the ability to cache gzip is a must

This can be done in nginx now by “layering” two nginx server blocks  
together. The “front” one implements proxy\_cache, while the back one  
does compression and talks to the origin server. You get twice the  
number of connections when you’re actually talking to a back-end, but  
if your cache hit ratio is high, that shouldn’t matter and the  
connections are very short-lived.

You should also “normalize” the incoming accept-encoding headers to  
either “gzip” or “”, and use that as part of the proxy cache key.

Something like this (untested syntax):

#frontend configuration which talks to client and caches  
server {  
listen 80  
set $myacceptencoding “”;  
if ($http\_accept\_encoding \*~ “gzip”) {  
set $myacceptencoding “gzip”;  
}  
location / {  
proxy\_set\_header “Accept-Encoding” $myacceptencoding;  
proxy\_cache my\_cache\_zone\_name;  
proxy\_cache\_key “$scheme$host$request\_uri$myacceptencoding”  
proxy\_pass [http://127.0.0.01:10080](http://127.0.0.01:10080)  
}  
}  
#backend server block which talks to origin and compresses  
server {  
listen 10080  
gzip on;  
gzip\_http\_version 1.0;  
gzip\_proxied any;  
gzip\_types text/css text/javascript text/xml application/x-javascript;  
location / {  
proxy\_pass [http://realbackend](http://realbackend)  
}  
}

–  
RPM
