Nginx support for http/1.1 backend

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

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 :slight_smile:

– Pasi

Seconded. Also the ability to cache gzip is a must

Sent from my iPod

On Tue, Oct 19, 2010 at 6:54 AM, Splitice [email protected] 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
}
}
#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
}
}


RPM

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs