-
Notifications
You must be signed in to change notification settings - Fork 343
Varnish Support
AbdelrahmanElawady edited this page May 12, 2023
·
15 revisions
This wiki page is for documenting the steps for adding Varnish Cache support to t3c
.
This section discusses mapping ATS configuration files to VCL (Varnish Configuration Language).
This mapping is only in the context of Traffic Control so some of the functionality of ATS configuration files might not be addressed.
From ipallowdotyaml.go we notice the following:
- No conditions are set on outbound connections.
- Only methods with conditions are:
PUSH
,DELETE
andPURGE
. - Localhost is trusted.
One way to meet the previous specification:
- Use
acl
for each method containing only allowed ips for that method. - At the start of
vcl_recv
check for each method with the matchingacl
.
Example:
acl purgers {
...
"127.0.0.1";
}
sub vcl_recv {
if (req.method == "PURGE") {
if (!client.ip ~ purgers) {
return (synth(405, "Not allowed."));
}
return (purge);
}
}