Skip to content

Instantly share code, notes, and snippets.

@fordnox
Last active August 29, 2015 13:59
Show Gist options
  • Save fordnox/10677161 to your computer and use it in GitHub Desktop.
Save fordnox/10677161 to your computer and use it in GitHub Desktop.
Most simple varnish VCL /etc/varnish/1fh.vcl
backend default {
.host = "127.0.0.1"; # IP address of your backend (Apache, nginx, etc.)
.port = "8080"; # Port your backend is listening on
}
sub vcl_recv {
# Set the URI of your system directory
if (req.request == "POST" || req.http.X-Requested-With == "XMLHttpRequest")
{
return (pass);
}
unset req.http.Cookie;
return(lookup);
}
sub vcl_fetch {
# Our cache TTL
set beresp.ttl = 1m;
return(deliver);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment