Welcome! Log In Create A New Profile

Advanced

nginx http/1.1 upstream server

Posted by nfm 
nfm
nginx http/1.1 upstream server
October 15, 2009 11:16AM
I'm trying to use nginx as a loadbalancer for a large number of tomcat servers. The application running on the tomcat servers works that a flash client are requesting a connection which then are used to push information to the flash clients.

The problem seems to be that nginx are accepting the connection http/1.1 connection but then somehow converts it into a http/1.0 connection against the upstream tomcat servers which causes the connection to fail and no data are pushed.

I wonder if this i a normal behavior and if there are any type of workarounds for this?

The application are built on blazeds if that may help.

There a cut from my configuration:

[code]
worker_processes 4;

error_log logs/error.log;

events {
worker_connections 8196;
}


http {
include mime.types;
default_type application/octet-stream;

log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

sendfile on;
keepalive_timeout 75 20;

gzip on;
gzip_min_length 1100;
gzip_buffers 4 8k;
gzip_types text/plain;

upstream pusher {
ip_hash;
server 10.21.6.5:8080;
server 10.21.6.5:8081;
server 10.21.6.5:8082;
server 10.21.6.5:8083;
server 10.21.6.6:8080;
server 10.21.6.6:8081;
server 10.21.6.6:8082;
server 10.21.6.6:8083;
server 10.21.6.7:8080;
server 10.21.6.7:8081;
server 10.21.6.7:8082;
server 10.21.6.7:8083;
server 10.21.6.8:8080;
server 10.21.6.8:8081;
server 10.21.6.8:8082;
server 10.21.6.8:8083;
server 10.21.6.23:8080;
server 10.21.6.23:8081;
server 10.21.6.23:8082;
server 10.21.6.23:8083;
server 10.21.6.24:8080;
server 10.21.6.24:8081;
server 10.21.6.24:8082;
server 10.21.6.24:8083;
server 10.21.6.45:8080;
server 10.21.6.45:8081;
server 10.21.6.45:8082;
server 10.21.6.45:8083;
server 10.21.6.22:8080;
server 10.21.6.22:8081;
server 10.21.6.22:8082;
server 10.21.6.22:8083;
}
server {
listen <hidden>:80;
server_name <hidden>;
access_log logs/access-pusher.log main;
location / {
if ($http_cookie ~* "jsessionid=([^;]+)(?:;|$)")
{
set $co "jsessionid=$1";
}
proxy_set_header Cookie "$co";
proxy_pass http://pusher;
}
}
}
[/code]
Re: nginx http/1.1 upstream server
October 15, 2009 11:24AM
Currently nginx only supports http/1.1 connection with client. Backend connections are http/1.0. See http://wiki.nginx.org/NginxHttpProxyModule.

--
Jim Ohlstein
nfm
Re: nginx http/1.1 upstream server
October 15, 2009 03:42PM
Thanks for your fast answer!

I've unfortunately not been too involved in the nginx development so I don't know if there's any special reason to not implement this functionality?

My wonder are anyway if this are a function that's planned soon or if I've to search for other solutions which are sin since I'm very pleased with the functionality of nginx on php sites I already use it for.
Re: nginx http/1.1 upstream server
October 15, 2009 04:10PM
I know that it is planned but I don't believe that a public timeline exists. Maxim Dounin has done some work on module for upstream keepalive at http://mdounin.ru/hg/ but I don't know how well it's been tested in production.

--
Jim Ohlstein
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 162
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready