Skip to content
AbdelrahmanElawady edited this page May 12, 2023 · 15 revisions

This wiki page is for documenting the steps for adding Varnish Cache support to t3c.

ATS Configuration to VCL Mapping

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.

ip_allow.yaml

From ipallowdotyaml.go we notice the following:

  • No conditions are set on outbound connections.
  • Only methods with conditions are: PUSH, DELETE and PURGE.
  • 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 matching acl.

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);
  }
}
Clone this wiki locally