Giter VIP home page Giter VIP logo

varnish-6.0-configuration-templates's Introduction

Varnish Configuration Templates (boilerplate)

๐Ÿš€ Need help implementing Varnish?

I'm available for consultancy if you're struggling with implementing Varnish and speeding up your site. Don't be afraid to reach out!

Installation

You can use the configuration templates found in this repository to quickly get started with a complete Varnish configuration that offers support for most functionality. Start of by looking into "default.vcl" and taking the bits you need, copy it to your own default.vcl.

What is it?

A set of configuration samples used for Varnish 5.0 with various features:

  • Server-side URL rewriting
  • Clean error pages for debugging
  • Virtual Host implementations
  • Various header normalizations
  • Cookie manipulations
  • 301/302 redirects from within Varnish

Common troubleshooting

Common list of errors and their fixes:

Basic troubleshooting:

Click here for a Varnish 3 VCL config template

Click here for a Varnish 4 VCL config template

Click here for a Varnish 5 VCL config template

varnish-6.0-configuration-templates's People

Contributors

boenner avatar iamshgulati avatar jesperweiland avatar loicmahieu avatar mattiasgeniar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

varnish-6.0-configuration-templates's Issues

probleam in clear cache

I applied the vcl settings well, but after one page is cached and I open another page that is not cached, the page that was previously cached is missed and hit again.

std.querysort not working properly with WordPress < 5.3.x (and probably others as well)

Hi, there is a minor issue with using this snippet:

# Normalize the query arguments
set req.url = std.querysort(req.url);

The main problem here is that WordPress < 5.3.x doesn't like presorted url parameters (messes up wp-admin dashboard icons etc.)
Reference: https://core.trac.wordpress.org/ticket/45346

There's a patch-set for WordPress coming in the next release (slated for mid september alledgedly), but I guess this might actually affect other applications as well, if they require 'specific' ordering.

Header normalize function leaves req.http.Host empty

This function leaves the req.http.Host empty in when there's no Host header present. I saw this when monitoring an ip with Nagios check_http -I $ip

set req.http.Host = regsub(req.http.Host, ":[0-9]+", "");

I fixed it by checking if req.http.Host is not empty, but it should probably be the default in these templates.

if (req.http.Host) {
 set req.http.Host = regsub(req.http.Host, ":[0-9]+", "");
}

req.method == "PURGE" causes loop and "too many requests" error.

This if statement in vcl_purge req.method == "PURGE" causes my setup to loop and error out with "Too many requests" error when I send PURGE request. Counterintuitively, when I change it to req.method != "PURGE", PURGE works and everything is fine.

My setup is based on varnish-4.0-configuration-templates so my setup had req.method != "PURGE" from back when you first made this change based on this Github Issue.

But then it was changed back to req.method == "PURGE" in this commit.

Then in varnish-5.0-configuration-templates, it goes back to req.method != "PURGE".

This carries through in 6.0 default.vcl until this patch changes it again back to req.method == "PURGE"

I am just curious to understand these changes. For me, req.method != "PURGE" seems wrong logically but it's the only change that fixes my PURGE issue.

Note that I use NGINX as the backend and also for TLS termination so I am not sure if this is what causes this to appear like a bug to me.

Cheers

vcl_miss cannot be used

Error:
Message from VCC-compiler:
Symbol cannot be used here.
('/etc/varnish/default.vcl' Line 281 Pos 5)
sub vcl_miss {
----########--

Running VCC-compiler failed, exited with 2

missing curly brackets in vcl_hit

Error:
Message from VCC-compiler:
Symbol not found.
('/opt/bitnami/varnish/etc/varnish/default.vcl' Line 281 Pos 1)
sub vcl_miss {
###-----------

Running VCC-compiler failed, exited with 2
VCL compilation failed
/opt/bitnami/varnish/scripts/ctl.sh : varnish could not be started

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.