Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 554 Bytes

Check-vcl-file-syntax-before-restarting.md

File metadata and controls

23 lines (17 loc) · 554 Bytes
  • Date : 2018-01-31
  • Tags : #varnish

Check vcl file syntax before restarting

Like NginX, Varnish has a syntax checker function that helps us test the syntactic correctness.

$ varnishd -C -f [vcl file path]

Varnish will compile the file and output the result to stdout. If something goes wrong, it will throw a message like

> Message from VCC-compiler:
> Expected an action, 'if', '{' or '}'
> ('input' Line 74 Pos 6)
>     vcl_hash(req.http.Cookie);
> -----########------------------
>
> Running VCC-compiler failed, exit 1