Add Varnish Docs #1809

Merged
merged 1 commit into from Sep 1, 2015

Projects

None yet

5 participants

@Rosiak
Contributor
Rosiak commented Aug 30, 2015
@Rosiak Rosiak Add Varnish Docs
- Fix #1808
65e38c6
@f0o
Member
f0o commented Aug 30, 2015

Here the settings we use on the demo, FYI.

# varnishd -V
varnishd (varnish-3.0.2 revision 55e70a4)
Copyright (c) 2006 Verdens Gang AS
Copyright (c) 2006-2011 Varnish Software AS
backend default {
    .host = "127.0.0.1";
    .port = "82";
}

sub vcl_recv {
 if (req.url ~ "\.(png|gif|jpg|swf|css|js)$" || req.url ~ ".*(graph\.php|/fonts/).*") {
  return(lookup);
 }
 if (req.restarts == 0) {
  if (req.http.x-forwarded-for) {
   set req.http.X-Forwarded-For =
   req.http.X-Forwarded-For + ", " + client.ip;
  } else {
   set req.http.X-Forwarded-For = client.ip;
  }
 }
 if (req.request != "GET" &&
     req.request != "HEAD" &&
     req.request != "PUT" &&
     req.request != "POST" &&
     req.request != "TRACE" &&
     req.request != "OPTIONS" &&
     req.request != "DELETE") {
  /* Non-RFC2616 or CONNECT which is weird. */
  return (pipe);
 }
 if (req.request != "GET" && req.request != "HEAD") {
  /* We only deal with GET and HEAD by default */
  return (pass);
 }
 if (req.http.Authorization || req.http.Cookie) {
  /* Not cacheable by default */
  return (pass);
 }
 return (lookup);
}

sub vcl_fetch {
 if (beresp.ttl < 300s) {
  set beresp.ttl = 300s;    
 }
 if (req.url ~ "\.(png|gif|jpg|swf|css|js)$" || req.url ~ ".*(graph\.php|/fonts/).*") {
  unset beresp.http.set-cookie;
 }
 return (deliver);
}

sub vcl_deliver {
 remove resp.http.Via;
 remove resp.http.X-Varnish;
 remove resp.http.Server;
 remove resp.http.Age;
 return (deliver);
}
@f0o f0o added the Documentation label Aug 30, 2015
@laf
Member
laf commented Aug 31, 2015

Do we need to get the example config into the doc?

@masonke
masonke commented Aug 31, 2015

If there is an example people can use to start from, that would be a huge help.
~KEM

@Rosiak
Contributor
Rosiak commented Aug 31, 2015

The default config should work, havnen't looking into the 2.x vs 3.x config from @f0o .

@laf laf merged commit 48bfc1e into librenms:master Sep 1, 2015

2 checks passed

Auto-Deploy Build finished.
Details
Scrutinizer No new issues
Details
@Rosiak Rosiak deleted the Rosiak:issue-1808 branch Feb 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment