forked from DanielSarmiento04/kairos-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig_advanced.json
More file actions
115 lines (115 loc) · 2.91 KB
/
config_advanced.json
File metadata and controls
115 lines (115 loc) · 2.91 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
{
"version": 1,
"jwt": {
"secret": "your-super-secret-key-change-this-in-production-minimum-32-characters",
"issuer": "kairos-gateway",
"audience": "api-clients",
"required_claims": ["sub", "exp", "iat"]
},
"rate_limit": {
"strategy": "PerIPAndRoute",
"requests_per_window": 100,
"window_duration": 60,
"burst_allowance": 50,
"window_type": "SlidingWindow",
"enable_redis": false,
"redis_key_prefix": "kairos_rl"
},
"routers": [
{
"_comment": "Legacy single backend configuration (backward compatible)",
"host": "http://httpbin.org",
"port": 80,
"external_path": "/api/legacy/get",
"internal_path": "/get",
"methods": ["GET"],
"auth_required": false
},
{
"_comment": "Load balanced route with round-robin strategy",
"backends": [
{
"host": "http://httpbin.org",
"port": 80,
"weight": 1
},
{
"host": "http://httpbin.org",
"port": 80,
"weight": 1
}
],
"load_balancing_strategy": "round_robin",
"external_path": "/api/users/{id}",
"internal_path": "/json",
"methods": ["GET"],
"auth_required": false,
"retry": {
"max_retries": 3,
"initial_backoff_ms": 100,
"max_backoff_ms": 5000,
"backoff_multiplier": 2.0,
"retry_on_status_codes": [502, 503, 504],
"retry_on_connection_error": true
}
},
{
"_comment": "Weighted load balancing example",
"backends": [
{
"host": "http://httpbin.org",
"port": 80,
"weight": 2
},
{
"host": "http://httpbin.org",
"port": 80,
"weight": 1
}
],
"load_balancing_strategy": "weighted",
"external_path": "/api/weighted/test",
"internal_path": "/anything",
"methods": ["GET", "POST"],
"auth_required": false,
"retry": {
"max_retries": 2,
"initial_backoff_ms": 50,
"max_backoff_ms": 2000,
"backoff_multiplier": 2.0,
"retry_on_status_codes": [503, 504],
"retry_on_connection_error": true
}
},
{
"_comment": "IP hash for session persistence",
"backends": [
{
"host": "http://httpbin.org",
"port": 80,
"weight": 1
}
],
"load_balancing_strategy": "ip_hash",
"external_path": "/api/session/{id}",
"internal_path": "/uuid",
"methods": ["GET"],
"auth_required": false
},
{
"_comment": "Random load balancing",
"backends": [
{
"host": "http://httpbin.org",
"port": 80,
"weight": 1
}
],
"load_balancing_strategy": "random",
"external_path": "/api/random/test",
"internal_path": "/delay/1",
"methods": ["GET"],
"auth_required": false
}
]
}