traefik/integration/fixtures/headers/cors.toml
2019-07-15 10:22:03 +02:00

42 lines
975 B
TOML

[global]
checkNewVersion = false
sendAnonymousUsage = false
[log]
level = "DEBUG"
[entryPoints]
[entryPoints.web]
address = ":8000"
[providers.file]
filename = "{{ .SelfFilename }}"
## dynamic configuration ##
[http.routers]
[http.routers.router1]
rule = "Host(`test.localhost`)"
middlewares = ["cors"]
service = "service1"
[http.routers.router2]
rule = "Host(`test2.localhost`)"
middlewares = ["nocors"]
service = "service1"
[http.middlewares]
[http.middlewares.cors.headers]
accessControlAllowMethods= ["GET", "OPTIONS", "PUT"]
accessControlAllowOrigin = "origin-list-or-null"
accessControlMaxAge = 100
addVaryHeader = true
[http.middlewares.nocors.Headers]
[http.middlewares.nocors.Headers.CustomResponseHeaders]
X-Custom-Response-Header = "True"
[http.services]
[http.services.service1.loadBalancer]
[[http.services.service1.loadBalancer.servers]]
url = "http://127.0.0.1:9000"