/
kratgo.conf.yml
101 lines (84 loc) · 2.81 KB
/
kratgo.conf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
###########################
# KRATGO CONFIGURATION
###########################
# IMPORTANT: Be careful with the tabulation indentation
# --- Variables ---
# $(method) : request method
# $(host) : request host
# $(path) : request path
# $(contentType) : response backend's content type
# $(statusCode) : response backend's status code
# $(req.header::<NAME>) : request header name
# $(resp.header::<NAME>) : response header name
# $(cookie::<NAME>) : request cookie name
# --- Operators ---
# Modifiers: + - / * & | ^ ** % >> <<
# Comparators: > >= < <= == != =~ !~
# Logical ops: || &&
# Numeric constants, as 64-bit floating point (12345.678)
# String constants (single quotes: 'foobar')
# Date constants (single quotes, using any permutation of RFC3339, ISO8601, ruby date, or unix date; date parsing is automatically tried with any string constant)
# Boolean constants: true false
# Parenthesis to control order of evaluation ( )
# Arrays (anything separated by , within parenthesis: (1, 2, 'foo'))
# Prefixes: ! - ~
# Ternary conditional: ? :
# Null coalescence: ??
# --- Log ---
# Log level: fatal | error | warning | info | debug
# Log output:
# - console: Write output in standard error
# - <file path>: Write output in log file
logLevel: info
logOutput: /var/log/kratgo/kratgo.log
# --- Cache ---
# ttl: Cache expiration in minutes
# cleanFrequency: Interval in minutes between removing expired entries (clean up)
# maxEntries: Max number of entries in cache. Used only to calculate initial size for cache
# maxEntrySize: Max size of entry in bytes
# hardMaxCacheSize: Limit for cache size in MB (Default value is 0 which means unlimited size)
cache:
ttl: 10
cleanFrequency: 1
maxEntries: 600000
maxEntrySize: 500
hardMaxCacheSize: 0
# --- Invalidator ---
# maxWorkers: Maximum workers to execute invalidations
invalidator:
maxWorkers: 5
# --- Proxy ---
# addr: IP and Port of Kratgo
# backendAddrs: Array with "addr:port" of the backends
# response: Configuration to manipulate reponse (Optional)
# headers:
# set: Configuration to SET headers from response (Optional)
# - name: Header name
# value: Value of header
# if: Condition to set this header (Optional)
#
# unset: Configuration to UNSET headers from response (Optional)
# - name: Header name
# if: Condition to unset this header (Optional)
#
# nocache: Conditions to not save in cache the backend response (Optional)
proxy:
addr: 0.0.0.0:6081
backendAddrs:
[
<addr1>:<port1>,
]
response:
headers:
set:
- name: X-Kratgo
value: true
unset:
- name: Set-Cookie
if: $(req.header::X-Requested-With) != 'XMLHttpRequest'
nocache:
- $(req.header::X-Requested-With) == 'XMLHttpRequest'
# --- Admin ---
# addr: IP and Port of admin api
admin:
addr: 0.0.0.0:6082