Problem Upgrade to Varnish 4.1 - Multiple Backends Not Working
Drew, AJ
Drew.AJ at principal.com
Fri Sep 23 13:52:14 CEST 2016
Hello,
We are trying to upgrade to Varnish 4.1 from Varnish 3.0.5.
Most things are working fine, but a big problem we are running into is that we have multiple backends. We switch backends based on URLs. This was working fine in Varnish 3, but when we switched over to Varnish 4, it stopped working.
I have tried many variations of the URLs, and even simplified the directors so that they only contain one backend (in my tests) so that I could switch from trying the backend directly to trying the director.
Using either of the options does not seem to matter.
Has anyone else run into this problem?
Here are the sections of my VCL that contain the backends / director definitions and the if statements to switch. I have also left in the different options (lines) I have used to come up with different combinations for testing.
probe B_probe {
.request =
"GET /zzzzzz/status.php HTTP/1.1"
"HOST: xxxxxx.example.com"
"Connection: close";
.timeout = 0.3 s;
.window = 8;
.threshold = 7;
}
backend B_backend1 {
.host = "162.131.196.220";
.port = "8080";
.probe = B_probe;
}
backend syscheck {
# .host = "localhost";
.host = "127.0.0.1";
.port = "8081";
}
backend searchBackend {
.host = "rp.www.example.com";
.port = "80";
}
backend providerBackend {
.host = "172.23.82.28";
.port = "80";
}
sub vcl_init {
new examplehosts = directors.round_robin();
examplehosts.add_backend(B_backend1);
new examplesyscheck = directors.round_robin();
examplesyscheck.add_backend(syscheck);
}
sub vcl_recv {
# set req.backend_hint = examplehosts.backend();
set req.backend_hint = B_backend1;
if (req.url ~ "^/syscheck/.*$") {
# if (req.url ~ "^/syscheck/*") {
# if (req.url ~ "^/syscheck/") {
set req.backend_hint = syscheck;
# set req.backend_hint = examplesyscheck.backend();
return(pass);
}
# Add simple health check for upstream load balancers
if (req.url ~ "^/health-check") {
return( synth(200, "UP"));
}
...
Thanks!
A J Drew
-----Message Disclaimer-----
This e-mail message is intended only for the use of the individual or entity to which it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended recipient, any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by reply email to Connect at principal.com and delete or destroy all copies of the original message and attachments thereto. Email sent to or from the Principal Financial Group or any of its member companies may be retained as required by law or regulation.
Nothing in this message is intended to constitute an Electronic signature for purposes of the Uniform Electronic Transactions Act (UETA) or the Electronic Signatures in Global and National Commerce Act ("E-Sign") unless a specific statement to the contrary is included in this message.
If you no longer wish to receive any further solicitation from the Principal Financial Group you may unsubscribe at https://www.principal.com/do-not-contact-form any time.
If you are a Canadian resident and no longer wish to receive commercial electronic messages you may unsubscribe at https://www.principal.com/do-not-email-request-canadian-residents any time.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20160923/43bf3583/attachment.html>
More information about the varnish-misc
mailing list