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 playing around the different config setups. Currently I have Varnish-cache in port 80, Apache2 in port 70 and Nginx in port 90 in the same machine.

The Varnish is configured in such way that it talks to Nginx by default, eg: config

.host = "localhost";
.port = "90";
.connect_timeout = 60s;
.first_byte_timeout = 300s;
.between_bytes_timeout = 300s;
.probe = basic;

My question is how to make Varnish fallback to Apache if Nginx is dead ?

The base config of Varnish with Apache is like this.

.host = "localhost";
.port = "70"
.connect_timeout = 60s;
.first_byte_timeout = 300s;
.between_bytes_timeout = 300s;
.probe = basic;

I want to trigger this config if the first config fails (I couldn't put perfectly in word, but yes, if Nginx is dead I want Varnish to Ping Apache).

Any hints or suggestions about the config would be really helpful. thanks.

share|improve this question

1 Answer 1

Try using a fallback director

There are several directors in Varnish, the fallback director will start to use an endpoint only if the others are considered dead.

share|improve this answer

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.