Clutch
Clutch

Reputation: 7610

Disable caching for certian IP's using varnish

Is it possible to let clients with certain IP's pass thru to the backend and not cache using varnish? I don't see this in any of the example configs.

Upvotes: 3

Views: 4471

Answers (2)

Łukasz Rysiak
Łukasz Rysiak

Reputation: 3078

i think better way is described here https://www.varnish-cache.org/lists/pipermail/varnish-misc/2011-October/021278.html

if you have list of IP's you should create an acl list:

acl passem {
        "192.168.55.0/24";
}

and then in vcl.recv you should

  if (client.ip ~ passem) {
    return(pass);
  }

Upvotes: 5

Clutch
Clutch

Reputation: 7610

I received this answer from the mailing list.

Yes, you can:

if (client.ip == IP)
{
return(pass);
}

Upvotes: 0

Related Questions