-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.toml
50 lines (39 loc) · 842 Bytes
/
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
# General gateway configuration
[server]
host = "0.0.0.0"
port = 8080
manager_port=8081
# Define routes
[[routes]]
path = "/service1"
methods = ["GET", "POST"]
strip_path= true
# Define upstreams for service1
[[routes.upstreams]]
url = "http://localhost:5001"
weight = 1
[[routes]]
path = "/service2"
methods = ["GET"]
strip_path= true
# Define upstreams for service2
[[routes.upstreams]]
url = "http://localhost:6001"
weight = 1
# Optional: Load balancing algorithm
[load_balancing]
algorithm = "round_robin" # Options: round_robin, random
# Optional: Rate limiting
[rate_limit]
requests_per_minute = 100
burst_limit = 20
# Optional: Logging
[logging]
level = "info"
file = "./toy_gateway.log"
[jwt]
secret_key=""
[cors]
allowed_origins = ["*"]
allowed_methods = ["GET", "POST"]
allowed_headers = ["Authorization", "Content-Type"]