Multiple requests on balancer

Hi guys,

I recently configured Nginx with Rails/Mongrel (mostly picking advices
from wiki)
where Nginx is doing balancing/proxy-ing on 5 Mongrels. It works
perfectly :slight_smile:

However, I noticed how each request to Nginx is routed to every Mongrel:
is this
desired behavior or I, possibly, did something wrong with
configuration (couldn’t
figured out yet). Any ideas to make Nginx route request only to single
Mongrel
instance?

Thanks.

Best,
Sanel

Hi,

However, I noticed how each request to Nginx is routed to every Mongrel:
is this
desired behavior or I, possibly, did something wrong with
configuration (couldn’t
figured out yet). Any ideas to make Nginx route request only to single
Mongrel
instance?

You did something wrong.

Best regards,
Piotr S. < [email protected] >

Thank you for quick reply.

Below is working config file I’m using to test issue against.
I also checked config found at Ruby on Rails Blog / What is Ruby on Rails for? and
still it behaves the same.

Nginx details:
nginx version: nginx/0.8.34
built by gcc 4.1.2 20080704 (Red Hat 4.1.2-46)
TLS SNI support disabled
configure arguments: --with-http_ssl_module --prefix=/usr/nginx

Ideas?


worker_processes 1;

error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
sendfile on;
#tcp_nopush on;

keepalive_timeout  65;
gzip               on;

# mongrel servers
upstream mongrels {
    server 172.17.13.15:8000;
    server 172.17.13.15:8001;
    server 172.17.13.15:8002;
    server 172.17.13.15:8003;
    server 172.17.13.15:8004;
}

server {
listen 443 default ssl;
client_max_body_size 50M;

ssl_certificate      cert.pem;
ssl_certificate_key  cert.key;
ssl_session_timeout  5m;
ssl_protocols  SSLv2 SSLv3 TLSv1;

location / {
  proxy_set_header  X-Real-IP  $remote_addr;
  proxy_set_header X_FORWARDED_PROTO https;

  proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header Host $http_host;
  proxy_redirect off;
  proxy_max_temp_file_size 0;

  proxy_pass http://mongrels;
}

error_page   500 502 503 504  /500.html;
location = /50x.html {
  root   html;
}

}
}