Skip to content

Instantly share code, notes, and snippets.

@rezan
Created Feb 11, 2020
Embed
What would you like to do?
VTC with v1 routing to itself
varnishtest "VTC with v1 routing to itself"
# Start v1 with no VCL so we can get a addr and port
server s1 {} -start
varnish v1 -vcl+backend {} -start
varnish v1 -vcl+backend {
backend self
{
.host = "${v1_addr}";
.port = "${v1_port}";
}
sub vcl_recv
{
if (!req.http.self) {
set req.backend_hint = self;
set req.http.self = "true";
return (pass);
} else {
return (synth(200, "SELF"));
}
}
}
client c1 {
txreq
rxresp
expect resp.status == 200
expect resp.reason == "SELF"
} -run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment