This repository has been archived by the owner on May 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Config.toml
87 lines (78 loc) · 2.39 KB
/
Config.toml
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
# [[route]]
# listen_addr = "127.0.0.1:8080"
# target_addrs = ["127.0.0.1:80", "127.0.0.1:81"]
# timeout_seconds = 30
# balance_strategy = "round_robin"
# [[route]]
# listen_addr = "0.0.0.0:443"
# target_addrs = ["192.168.1.1:80", "192.168.1.2:80"]
# balance_strategy = "WeightedRoundRobin"
# target_weights = { "192.168.1.1:80" = 3, "192.168.1.2:80" = 1 }
# resource_endpoints = [
# "http://192.168.1.1:8080/stats",
# "http://192.168.1.2:8080/stats",
# ]
# timeout_seconds = 10
# max_requests_per_target = 150
# health_check_endpoints = { "192.168.1.1:80" = "http://192.168.1.1:8080/health", "192.168.1.2:80" = "http://192.168.1.2:8080/health" }
# cache_enabled_endpoints = ["/api/v1/data"]
# cache_ttl_seconds = 120
# cache_capacity = 2000
[[route]]
listen_addr = "localhost:5000"
target_addrs = ["http://127.0.0.1:5001"]
timeout_seconds = 20
balance_strategy = "random"
# [[route]]
# listen_addr = "localhost:5001"
# target_addrs = ["localhost:5250"]
# timeout_seconds = 20
# balance_strategy = "random"
# [[route]]
# listen_addr = "127.0.0.1:8080"
# target_addrs = ["127.0.0.1:80", "127.0.0.1:81"]
# timeout_seconds = 30
# balance_strategy = "ratelimiting"
# max_requests_per_target = 100
# [[route]]
# listen_addr = "0.0.0.0:8080"
# target_addrs = ["http://server1:8080", "http://server2:8080"]
# resource_endpoints = [
# "http://server1:8081/resources",
# "http://server2:8081/resources",
# ]
# balance_strategy = "resourcebased"
# timeout_seconds = 5
# max_requests_per_target = 100
# cache_enabled_endpoints = ["/api/data", "/api/static"]
# cache_capacity = 100
# [[route]]
# listen_addr = "127.0.0.1:8080"
# target_addrs = ["192.168.1.1:80", "192.168.1.2:80"]
# target_weights = { "192.168.1.1:80" = 3, "192.168.1.2:80" = 1 }
# resource_usage_api = [
# "http://192.168.1.1:8080/usage",
# "http://192.168.1.2:8080/usage",
# ]
# timeout_seconds = 5
# balance_strategy = "weightedroundrobin"
# max_requests_per_target = 100
# resource_endpoints = [
# "http://192.168.1.1:8080/resource",
# "http://192.168.1.2:8080/resource",
# ]
# cache_enabled_endpoints = [
# "http://192.168.1.1:8080/cache",
# "http://192.168.1.2:8080/cache",
# ]
# cache_ttl_seconds = 60
[retry_strategy]
strategy_type = "FixedDelay"
max_delay_secs = 2
max_attempts = 5
initial_delay_millis = 100
timeout_secs = 5
# [rate_limiting]
# strategy = "SlidingWindow" # Veya "FixedWindow"
# limit = 100
# window_size_seconds = 60