Skip to content

Instantly share code, notes, and snippets.

@gquintard
Last active September 30, 2016 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gquintard/ade655a67d66b5d443430681280198c1 to your computer and use it in GitHub Desktop.
Save gquintard/ade655a67d66b5d443430681280198c1 to your computer and use it in GitHub Desktop.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Varnish Configuration Object",
"type": "object",
"required": ["backends", "rules"],
"properties": {
"backends": {
"description": "list of origin servers",
"type": "array",
"items": {
"type": "object",
"required": ["name", "host"],
"properties": {
"name": { "type": "string" },
"host": { "type": "string" },
"port": { "type": "number" }
}
},
"probes": {
"description": "list of backend probes",
"type": "array",
"items": {
"type": "object",
"properties": {
"url": { "type": "string" },
"timeout": { "type": "number" },
"interval": { "type": "number" },
"window": { "type": "number" },
"threashold": { "type": "number" }
}
},
"clusters": {
"description": "list of server pools",
"type": "array",
"items": {
"type": "object",
"required": ["name", "strategy", "backends"],
"properties": {
"name": { "type": "string" },
"strategy": {
"type": "string",
"oneOf": [
{ "format": "round_robin"},
{ "format": "fallback"},
{ "format": "hash"},
{ "format": "random"}
]
},
"backends": {
"type": "array",
"items": "strings"
}
}
}
},
"rules": {
"description": "list of inbound rules",
"type": "array",
"items": {
"type": "object",
"required": ["check", "route"],
"properties": {
"check": {
"type": "string",
"oneOf": [
{ "format": "default"},
{ "format": "equal"},
{ "format": "not-equal"},
{ "format": "regex"},
{ "format": "not-regex"},
{ "format": "startswith"},
{ "format": "not-startwith"},
{ "format": "wildcard"},
{ "format": "not-wildcard"}
]
},
"field": {
"type": "string",
"oneOf": [
{ "format": "url"},
{ "format": "path"},
{ "format": "querystring"},
{ "format": "host"},
]
},
"pattern": {"type": "string"},
"route": {"type": "string"},
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment