75 lines
1.9 KiB
TOML
75 lines
1.9 KiB
TOML
defaultEntryPoints = ["http"]
|
|
|
|
logLevel = "DEBUG"
|
|
debug = true
|
|
|
|
[api]
|
|
|
|
[entryPoints]
|
|
[entryPoints.http]
|
|
address = ":8000"
|
|
|
|
[tracing]
|
|
backend = "{{.TracingBackend}}"
|
|
servicename = "tracing"
|
|
[tracing.zipkin]
|
|
httpEndpoint = "http://{{.ZipkinIP}}:9411/api/v1/spans"
|
|
debug = true
|
|
[tracing.jaeger]
|
|
samplingType = "const"
|
|
samplingParam = 1.0
|
|
|
|
[file]
|
|
|
|
[Routers]
|
|
[Routers.router1]
|
|
Service = "service1"
|
|
Middlewares = ["retry", "ratelimit"]
|
|
Rule = "Path:/ratelimit"
|
|
[Routers.router2]
|
|
Service = "service2"
|
|
Middlewares = ["retry"]
|
|
Rule = "Path:/retry"
|
|
[Routers.router3]
|
|
Service = "service3"
|
|
Middlewares = ["retry", "basic-auth"]
|
|
Rule = "Path:/auth"
|
|
|
|
[Middlewares]
|
|
[Middlewares.retry.retry]
|
|
attempts = 3
|
|
[Middlewares.basic-auth.BasicAuth]
|
|
users = ["test:$apr1$H6uskkkW$IgXLP6ewTrSuBkTrqE8wj/", "test2:$apr1$d9hr9HBB$4HxwgUir3HP4EsggP/QNo0"]
|
|
[Middlewares.ratelimit.RateLimit]
|
|
extractorfunc = "client.ip"
|
|
[Middlewares.ratelimit.RateLimit.rateset.rateset1]
|
|
period = "60s"
|
|
average = 4
|
|
burst = 5
|
|
[Middlewares.ratelimit.RateLimit.rateset.rateset2]
|
|
period = "3s"
|
|
average = 1
|
|
burst = 2
|
|
|
|
|
|
[Services]
|
|
[Services.service1]
|
|
[Services.service1.LoadBalancer]
|
|
passHostHeader = true
|
|
[[Services.service1.LoadBalancer.Servers]]
|
|
URL = "http://{{.WhoAmiIP}}:{{.WhoAmiPort}}"
|
|
Weight = 1
|
|
|
|
[Services.service2]
|
|
passHostHeader = true
|
|
[Services.service2.LoadBalancer]
|
|
[[Services.service2.LoadBalancer.Servers]]
|
|
URL = "http://{{.WhoAmiIP}}:{{.WhoAmiPort}}"
|
|
Weight = 1
|
|
|
|
[Services.service3]
|
|
passHostHeader = true
|
|
[Services.service3.LoadBalancer]
|
|
[[Services.service3.LoadBalancer.Servers]]
|
|
URL = "http://{{.WhoAmiIP}}:{{.WhoAmiPort}}"
|
|
Weight = 1
|