/
middleware.go
49 lines (48 loc) · 1.05 KB
/
middleware.go
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
package vulcand
var DefaultMiddleware = map[string]string{
RedirectSSLID: `{
"Priority": 1,
"Type": "rewrite",
"Middleware": {
"Regexp": "^http://(.*)",
"Replacement": "https://$1",
"Rewritebody": false,
"Redirect": true
}
}`,
TraceID: `{
"Priority": 1,
"Type": "trace",
"Middleware": {
"ReqHeaders": %s,
"RespHeaders": %s,
"Addr": "syslog://127.0.0.1:514",
"Prefix": "@app"
}
}`,
AuthID: `{
"Priority": 1,
"Type": "auth",
"Middleware": {
"User": "%s",
"Pass": "%s"
}
}`,
MaintenanceID: `{
"Priority": 1,
"Type": "cbreaker",
"Middleware": {
"Condition": "ResponseCodeRatio(500, 600, 0, 600) > 0.9",
"Fallback": {
"Type": "response",
"Action": {
"StatusCode": 503,
"Body": %q
}
},
"FallbackDuration": 1000000000,
"RecoveryDuration": 1000000000,
"CheckPeriod": 100000000
}
}`,
}