I am relatively new to using Varnish and am encountering an error when attempting to access my website. The error message I receive is as follows:
<body>
<h1>Error 503 Backend fetch failed</h1>
<p>Backend fetch failed</p>
<h3>Guru Meditation:</h3>
<p>XID: 3</p>
<hr>
<p>Varnish cache server</p>
</body>
Description of Issue: Despite adjusting the .timeout
value, it seems to have no impact as the error returns immediately. The following command works as intended:
curl --header "Host: serverx.dev" 192.168.56.10:8080/index.php
However, this command fails, resulting in a “Backend fetch failed” message:
curl --header "Host: serverx.dev" 192.168.56.10:80/index.php
Environment Details:
- Varnish version: 4.1.5
- Host OS: Windows 7 (64-bit)
- Guest OS: Debian Jessie (minimal install)
- Apache2 running on port 8080 and Varnish on port 80.
Varnish Configuration (default.vcl):
vcl 4.0;
import std;
import directors;
backend backendOne {
.host = "192.168.56.10";
.port = "8080";
.probe = {
.url = "/robots.txt";
.interval = 5s;
.timeout = 50s;
.window = 5;
.threshold = 3;
}
}
sub vcl_init {
new backendGroup = directors.round_robin();
backendGroup.add_backend(backendOne);
}
Current Varnish Status:
ps -ef | grep varnish
varnish 4210 1 0 11:26 ? 00:00:00 /usr/sbin/varnishd -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m
Additional Logs from Varnish:
- BereqHeader X-Varnish: 51
- VCL_call BACKEND_FETCH
- VCL_return fetch
- FetchError Director cluster returned no backend
- FetchError No backend
- BerespStatus 503
- BerespReason Service Unavailable
If anyone has insights or suggestions that could help resolve this problem, I would greatly appreciate it!