Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am running an nginx server behind a separate (L-4) load balancer that basically just serves static files and forwards requests to a downstream web server. This works great as long as all the services are running.

The problem is that if the downstream web server goes down, I want nginx to stop accepting all requests(so that the load balancer will notice it is down). Is it possible to do this? According to the nginx documentation, if there is only one server in the upstream group(say localhost), the max_failures setting is ignored, meaning nginx will continue to forward requests to the dead app server. Can I basically tell nginx to just stop everything after a certain number of failures?

EDIT Using L4 load balancing

share|improve this question

1 Answer 1

Tell the load balancer to check a URL which forwards to the backend service. TCP checks or requesting a static file are not sufficient.

share|improve this answer
    
Thanks but I am using level 4 load balancing, so not sure I can do that(plus the load balancer is basically out of my control, I have to use the GUI provided by the cloud service, and it doesnt have those kinds of options) –  user122875 Aug 6 '12 at 10:08
    
The layer at which load balancing takes place is unrelated to the possible health checks. Find a better load balancer or cloud service if the one you have doesn't support HTTP health checks. Even ELB supports HTTP health checks. –  womble Aug 6 '12 at 10:10
    
Not really under my control. –  user122875 Aug 6 '12 at 10:14
    
Of course it's under your control. –  womble Aug 6 '12 at 10:19
    
Maybe you and your employer have a different relationship than me and mine have then.... anyway this is getting way off topic. –  user122875 Aug 6 '12 at 10:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.