Have you looked at the proxy_next_upstream configuration?

http://wiki.nginx.org/NginxHttpProxyModule#proxy_next_upstream

It should do what you want.

Also, depending on yourapplication and traffic, it might also be worth looking into lowering fail_timeout.

Sajan Parikh
Owner, Noppix LLC

e: sa...@noppix.com
p: (563) 726-0371

Noppix LLC Logo
On 07/02/2013 11:55 PM, Sandeep L wrote:
Hi,


I am trying to configure nginx with upstream.


We have 3 machines where we run application server and proxy passing all requests from nginx to application serves.
I used following configuration in nginx:


upstream appcluster {
  server host1.example.com:8080 max_fails=2 fail_timeout=300s;
  server host2.example.com:8080 max_fails=2 fail_timeout=300s;
}


Now issue is if the request comes to nginx when one server is down due to unknown reasons its waiting for a long time getting response or some times its getting connection timeout.


Is there any module in nginx to get upstream servers status and forward requests only working upstream server.


Can someone suggest me right configuration to get response from appcluster without latency or connection time out whenever a server wont respond.


Thanks,
Sandeep.


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to