-
Notifications
You must be signed in to change notification settings - Fork 13
/
example.yaml
104 lines (96 loc) · 2.61 KB
/
example.yaml
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
102
103
# Validate this file by running `bin/sphinxd --validate /path/to/conf`
proxy:
handler: http # can be {http,httplogger}
host: http://httpbin.org # URI for the http(s) backend we are proxying to
listen: :6634 # bind to host:port. default: height of the Great Sphinx of Giza
allow-on-error: Yes # become passive proxy if error detected? (optional, default=No)
storage:
type: memory # must be one of {redis, dynamodb, memory}
host: localhost # redis hostname. required for redis
port: 6379 # redis port. required for redis
table: table # table name. required for dynamodb
region: us-west-1 # table region. required for dynamodb
health-check:
enabled: true
port: 60002
endpoint: "/health/check"
limits:
bearer-special:
interval: 15 # in seconds
max: 200 # number of requests allowed in interval
keys:
# buckets are keyed on concatnated values of these params
headers:
encrypt: "the_salt"
names:
- "Authorization"
ip: "" # ip keys require no configuration
global: "" # global keys have NO affect when used with other key types
matches:
# both headers and paths matches should be true for limit to apply
headers:
match_any:
- name: "Authorization"
match: "Bearer.*"
- name: "X-Forwarded-For"
paths:
match_any:
- "/special/resources/.*"
global-limit:
interval: 15
max: 500
keys:
global: "" # global key has no configuration
matches:
paths:
match_any:
- "/generic/resources/.*"
basic-simple:
interval: 15
max: 200
keys:
headers:
names:
- "Authorization"
matches:
headers:
match_any:
- name: "Authorization"
match: "Basic.*"
excludes:
# excludes are evaluated before matches and requests that
# match excludes are ignored
paths:
match_any:
- "/special/resources/.*"
basic-special:
interval: 15
max: 200
keys:
headers:
names:
- "Authorization"
matches:
paths:
match_any:
- "/special/resources/.*"
headers:
match_any:
- name: "Authorization"
match: "Basic.*"
bearer-simple:
interval: 15
max: 200
keys:
headers:
names:
- "Authorization"
matches:
headers:
match_any:
- name: "Authorization"
match: bearer
excludes:
paths:
match_any:
- "/special/resources/.*"