Defined Type: varnish::backend

Defined in:
puppet/modules/varnish/manifests/backend.pp

Overview

Define: varnish::backend

Sets up a new Varnish backend.

Parameters

host

Backend host.

port

Backend port.

onlyif

VCL condition for routing to the backend.

order

Order in which Varnish will apply configuration for the backend (0-99). Default: 21 (apply just after the default backend).

Examples

varnish::backend { 'thumbor':
    host   => '127.0.0.1',
    port   => '8888',
    onlyif => 'req.url ~ "^/images/thumb/.*\.(jpg|png)"',
}

Parameters:

  • host (Any)
  • port (Any)
  • onlyif (Any) (defaults to: 'req.url ~ "."')
  • order (Any) (defaults to: 21)


28
29
30
31
32
33
34
35
36
37
38
# File 'puppet/modules/varnish/manifests/backend.pp', line 28

define varnish::backend(
    $host,
    $port,
    $onlyif = 'req.url ~ "."',
    $order = 21,
) {
    varnish::config { "backend-${title}":
        content => template('varnish/backend.vcl.erb'),
        order   => $order,
    }
}