Hello everyone,

I'm using varnish-3.0.6-1 on one host and tomcat8 on another. Tomcat is running fine but for some reason I can't get varnish backend to be healthy.

Here's my config:

{code}
probe healthcheck {
.url = "/openam/";
.timeout = 3 s;
.interval = 10 s;
.window = 3;
.threshold = 2;
.expected_response = 302;
}

backend am {
.host = "<INTERNAL-IP>";
.port = "8090";
.probe = healthcheck;
}


sub vcl_recv {
if (req.request == "PURGE") {
if (!client.ip ~ purgers) {
error 405 "You are not permitted to PURGE";
}

return(lookup);
}

else if (req.http.host == "bla.domain.com" || req.http.host == "<EXTERNAL-IP>") {
set req.backend = am;
}

else if (req.url ~ "\.(ico|gif|jpe?g|png|bmp|swf|js)$") {
unset req.http.cookie;
set req.backend = lighttpds;
}

else {
set req.backend = apaches;
}
}{/code}


It always shows:

{code}
Backend_health - am Still sick 4--X-R- 0 2 3 0.001956 0.000000 HTTP/1.1 302
telnet works fine to that host, the only thing that I can't figure it out is that curl returns 302 and that's because main page under 'openam' on tomcat redirects to another page.
{/code}

{code}
$ curl -I h ttp://<INTERNAL-IP>:8090/openam/
HTTP/1.1 302
Location: h ttp://<INTERNAL-IP>:8090/openam/config/options.htm
Transfer-Encoding: chunked
Date: Tue, 12 Sep 2017 15:00:24 GMT
{/code}


Is there a way to fix that problem?

Any advice appreciated, Thanks