traefik/integration/fixtures/failover_statuscode.toml
Landry Benguigui 34ae66b9ab
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Build and Publish Documentation / Doc Process (push) Waiting to run
Build experimental image on branch / build-webui (push) Waiting to run
Build experimental image on branch / Build experimental image on branch (push) Waiting to run
Failover according to response status code
Co-authored-by: juliens <julien.salleyron@gmail.com>
2026-02-09 14:10:06 +01:00

47 lines
No EOL
1.2 KiB
TOML

[global]
checkNewVersion = false
sendAnonymousUsage = false
[api]
insecure = true
[log]
level = "DEBUG"
noColor = true
[entryPoints]
[entryPoints.web]
address = ":8000"
[providers.file]
filename = "{{ .SelfFilename }}"
## dynamic configuration ##
[http.routers]
[http.routers.router1]
entrypoints = ["web"]
service = "failover-service"
rule = "PathPrefix(`/`)"
[http.services]
# Failover service with error-based failover (status codes)
[http.services.failover-service]
[http.services.failover-service.failover]
service = "main-service"
fallback = "fallback-service"
[http.services.failover-service.failover.errors]
status = ["500-504"]
maxRequestBodyBytes = 1048576 # 1MB
# Main service (no health check - failover based on status codes only)
[http.services.main-service]
[http.services.main-service.loadBalancer]
[[http.services.main-service.loadBalancer.servers]]
url = "{{ .MainServer }}"
# Fallback service
[http.services.fallback-service]
[http.services.fallback-service.loadBalancer]
[[http.services.fallback-service.loadBalancer.servers]]
url = "{{ .FallbackServer }}"