<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have two backend that both of them are healthy and I use fallback for them and I want to say all request should goes to backend1 and if backend1 become unhealthy all requests should go to backend2 but backend1 has higher priority and when backend1 become
healthy, all requests should go to backend1,<br>
How can I define priority?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
my config:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
```</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
vcl 4.1;
<div><br>
</div>
<div>import directors;</div>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<div>probe myprobe {</div>
<div> .request =</div>
<div> "HEAD / HTTP/1.1"</div>
<div> "Connection: close"</div>
<div> "User-Agent: Varnish Health Probe";</div>
<div> .timeout = 1s;</div>
<div> .interval = 5s;</div>
<div> .window = 5;</div>
<div> .threshold = 3;</div>
<div>}</div>
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
backend backend1 { .host = "backend1"; .port = "8080"; .probe = myprobe; }
<div><br>
</div>
<div>backend backend2 { .host = "backend2"; .port = "8080"; .probe = myprobe; }</div>
<div>backend backend3 { .host = "backend3"; .port = "8080"; .probe = myprobe; }</div>
<br>
<div><br>
</div>
<div>sub vcl_init {</div>
<div><br>
</div>
<div> new backend2_cluster = directors.round_robin();</div>
<div> backend2_cluster.add_backend(backend2);</div>
<div> backend3_cluster.add_backend(backend3);</div>
<br>
<div><br>
</div>
<div> new backend_cluster_fb = directors.fallback();</div>
<div> backend1_fb.add_backend(backend1);</div>
<div> backend2_cluster_fb.add_backend(backend2_cluster.backend());</div>
<div>}</div>
<div><br>
</div>
<div>sub vcl_recv {</div>
<div> set req.backend_hint = backend_cluster_fb.backend();</div>
<div><br>
</div>
<div>}<br>
<br>
```<br>
</div>
<br>
</div>
</body>
</html>