Giter Site home page Giter Site logo

varnish-5.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:

There is already a newer version out: Varnish 6 VCL config template.

varnish-5.0-configuration-templates's People

Contributors

mattiasgeniar avatar oaattia 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

varnish-5.0-configuration-templates's Issues

commands for cookies is not vaild for version 5

https://ma.ttias.be/varnish-tip-see-cookies-stripped-vcl/

is not working for varnish 5

it shows:
`varnishlog: invalid option -- 'm'
Usage: varnishlog

Options:
[-a] Append to file
[-A] Text output
[-b] Only display backend records
[-c] Only display client records
[-C] Caseless regular expressions
[-d] Process old log entries and exit
[-D] Daemonize
[-g <session|request|vxid|raw>] Grouping mode (default: vxid)
[-h] Usage help
[-i ] Include tags
[-I <[taglist:]regex>] Include by regex
[-k ] Limit transactions
[-L ] Incomplete transaction limit
[-n

] varnishd working directory
[-N ] VSM filename
[-P ] PID file
[-q ] VSL query
[-r ] Binary file input
[-t <seconds|off>] VSM connection timeout
[-T ] Transaction end timeout
[-v] Verbose record printing
[-V] Version
[-w ] Output filename
[-x ] Exclude tags
[-X <[taglist:]regex>] Exclude by regex`

Not working for me

โ— varnish.service - Varnish Cache, a high-performance HTTP accelerator
Loaded: loaded (/lib/systemd/system/varnish.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2016-12-16 15:00:19 UTC; 9s ago
Process: 15812 ExecStart=/usr/sbin/varnishd -a :6081 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,256m (code=exited, status=2)

Dec 16 15:00:19 proxima varnishd[15812]: sub vcl_hit {
Dec 16 15:00:19 proxima varnishd[15812]: ----#######--
Dec 16 15:00:19 proxima varnishd[15812]: ...which is the "vcl_hit" method
Dec 16 15:00:19 proxima varnishd[15812]: Legal returns are: "deliver" "miss" "pass" "restart" "synth"
Dec 16 15:00:19 proxima varnishd[15812]: Running VCC-compiler failed, exited with 2
Dec 16 15:00:19 proxima varnishd[15812]: VCL compilation failed
Dec 16 15:00:19 proxima systemd[1]: varnish.service: Control process exited, code=exited status=2
Dec 16 15:00:19 proxima systemd[1]: Failed to start Varnish Cache, a high-performance HTTP accelerator.
Dec 16 15:00:19 proxima systemd[1]: varnish.service: Unit entered failed state.
Dec 16 15:00:19 proxima systemd[1]: varnish.service: Failed with result 'exit-code'.

High hits but the get request for the css, js,..... are not getting the header

Hi

thanks a lot for ur template hope u continue work on it

I had this stats
https://www.dropbox.com/s/njmi3cbf4myrlkg/Screenshot%202017-05-15%2002.14.18.png?dl=0
https://www.dropbox.com/s/qgfplha8lmx513w/Screenshot%202017-05-15%2002.13.23.png?dl=0

but in Pingdom i get this header:

https://www.dropbox.com/s/gz3b8dprxreqoxc/Screenshot%202017-05-15%2002.21.56.png?dl=0

is this is because "co-cache" ? but it is on for most files, although I asked varnish to ignore the cookie that my WordPress sets for a guest

please help me

Miss hit on CTRL-F5

I love the script! works perfect, except on one thing:

When I push CTRL-F5 I always get a miss-hit.

Is this normal?

Improvement: BAN is not supported

BAN is not supported. Its used for Drupal 8. See geerlingguy/drupal-vm#397.

sub vcl_recv {

    ...

    # Only allow BAN requests from IP addresses in the 'purge' ACL.
    if (req.method == "BAN") {
        # Same ACL check as above:
        if (!client.ip ~ purge) {
            return (synth(403, "Not allowed."));
        }

        # Logic for the ban, using the Cache-Tags header.
        if (req.http.Cache-Tags) {
            ban("obj.http.Cache-Tags ~ " + req.http.Cache-Tags);
        }
        else {
            return (synth(403, "Cache-Tags header missing."));
        }

        # Throw a synthetic page so the request won't go to the backend.
        return (synth(200, "Ban added."));
    }

    ...

}

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.