Varnish

General configuration for Varnish. At least one http or https listen endpoint must be specified, all other parameters are optional.

Example:

varnish:
  http:
  - port: 80

http

Type: List

A list of HTTP ports for Varnish to bind and listen to. Varnish needs at least one http port or one https port.

port

varnish:
  http:
  - port: 80

Type: Integer

The port number to listen to. If address is not also specified, varnish will listen on all available interfaces.

address

varnish:
  http:
  - address: 127.0.0.1:80

Type: String

The interface address to bind to. Can specify both address and port, or used in combination with port.

https

Type: List

A list of HTTPS listeners for Varnish to bind to. Each listener must have at least one certificate.

port

varnish:
  https:
  - port: 443
    certificates:
    - self_signed: example.com

Type: Integer

The port number to listen to. If address is not also specified, varnish will listen on all available interfaces.

address

varnish:
  http:
  - address: 127.0.0.1:443
    certificates:
    - self_signed: example.com

Type: String

The interface address to bind to. Can specify both address and port, or used in combination with port.

certificates

Type: List

The certificates to use for this HTTPS listener.

combined

varnish:
  https:
  - port: 443
    certificates:
    - combined: /tmp/combined.pem

Type: String

Path to a combined certificate and private key PEM file. Mutually exclusive with cert and private_key.

cert

varnish:
  https:
  - port: 443
    certificates:
    - cert: /etc/varnish-supervisor/cert.crt
      private_key: /etc/varnish-supervisor/private.key

Type: String

Path to a certificate PEM file. If specified, a private_key must be specified as well.

private_key

varnish:
  https:
  - port: 443
    certificates:
    - cert: /etc/varnish-supervisor/cert.crt
      private_key: /etc/varnish-supervisor/private.key

Type: String

Path to a private key PEM file. If specified, a cert must be specified as well.

self_signed

varnish:
  https:
  - port: 443
    certificates:
    - self_signed: "localhost"
    - self_signed: "*.localhost"
    - self_signed: "example.com"

Type: String

Generate a self-signed certificate. This is useful for testing with clients that accept non-trusted certificates. Supports wildcards for wildcard TLS certificates.

For automatic trusted TLS, see ACME.

storage

Note: Orca Premium feature

Configure a persistent cache for Varnish to use. This will generate the appropriate Massive Storage Engine (MSE) 4 configuration and initialize it with mkfs.mse4. Changes to the config will be applied upon restart of the Supervisor.

stores

Type: List

A list of stores for the persisted cache. A store appears as a single large file on the file system and is used to persist chunks of cached objects.

An auxiliary file called a book is created alongside the store, which keeps track of where the object chunks in the store are and other metadata such as cache invalidation keys and checksums for durable storage.

Each store must have a name, path and size.

name

varnish:
  storage:
    stores:
    - name: disk1
      path: /etc/varnish-supervisor/storage/disk1
      size: 1000G

Type: String

The unique identifying name for this store.

path

varnish:
  storage:
    stores:
    - name: disk1
      path: /etc/varnish-supervisor/storage/disk1
      size: 1000G

Type: String

Path to a directory where the the store and book files will be created at Supervisor startup. The backing storage must have space to fit size bytes.

size

varnish:
  storage:
    stores:
    - name: disk1
      path: /etc/varnish-supervisor/storage/disk1
      size: 1000G

Type: String

Size of the store to create. Available case-insensitive units are K, M, G, and T.

The size includes the size of the book (5G by default) and filesystem overhead (1G), so the size of the store file can be calculated as:

store_size = size - book_size - 1G.

Must be larger than book_size + 1G.

book_size

varnish:
  storage:
    stores:
    - name: disk1
      path: /etc/varnish-supervisor/storage/disk1
      size: 1000G
      book_size: 2G

Type: String

Default: 5G

Change the size of a store’s book. When the size of a book is increased, the size of the store is decreased, and vice versa.

category

varnish:
  storage:
    default_category: other
    stores:
    - name: disk1
      path: /disk1
      size: 1000G
      category: media.video
    - name: disk2
      path: /disk2
      size: 1000G
      category: media.video
    - name: icons
      path: /disk3/icons
      size: 50G
      category: media.images.icons
    - name: pictures
      path: /disk3/pictures
      size: 150G
      category: media.images.pictures
    - name: other
      path: /disk3/other
      size: 800G
      category: other

Type: String

Assign a category to the store. This reserves the store to be used exclusively for objects of the same category. Multiple stores can have the same category, in which case objects are spread evenly over the stores.

Object category can be set in VCL sub vcl_backend_response with the mse4 VMOD:

mse4.set_category("media.video");

If no category has been set in VCL, the category defined by default_category is used.

Categories are a tree structure, and each store category must be a leaf-node in that tree. This means that if one store has the category media.images.icons, another store cannot have the category media.images.

When categories are used, all stores must have a category and default_category must be set.

default_category

varnish:
  storage:
    default_category: blobs
    stores:
    - name: manifests
      path: /disk1/manifests
      size: 100G
      category: manifests
    - name: objects
      path: /disk1/objects
      size: 900G
      category: objects

Type: String

The default category to use if no category have been set in VCL.

Required if categories are used.

admin_port

varnish:
  admin_port: 1234

Type: Integer

Default: 1092

Target port for the reverse admin interface.

work_dir

varnish:
  work_dir: /var/lib/varnish

Type: String

Default: Derived from system defaults

Varnish working directory (equivalent to varnishd -n). This is the directory where Varnish stores its shared memory logs and other runtime files.

path

varnish:
  path: /path/to/varnishd

Type: String

Default: Derived from system $PATH

Path to the varnishd binary to use.

params

varnish:
  params:
    workspace_backend: 128k

Parameters for Varnish. See params.


®Varnish Software, Wallingatan 12, 111 60 Stockholm, Organization nr. 556805-6203