Moved traefik config fille
This commit is contained in:
59
etc/traefik/traefik.toml
Normal file
59
etc/traefik/traefik.toml
Normal file
@ -0,0 +1,59 @@
|
||||
[entryPoints]
|
||||
[entryPoints.web]
|
||||
address = ":80"
|
||||
[entryPoints.web.http.redirections.entryPoint]
|
||||
to = "websecure"
|
||||
scheme = "https"
|
||||
|
||||
[entryPoints.websecure]
|
||||
address = ":443"
|
||||
|
||||
[providers.docker]
|
||||
endpoint = "unix:///var/run/docker.sock"
|
||||
exposedByDefault = false
|
||||
|
||||
[certificatesResolvers.le.acme]
|
||||
email = "your-email@example.com"
|
||||
storage = "/data/acme.json"
|
||||
[certificatesResolvers.le.acme.tlsChallenge]
|
||||
|
||||
[api]
|
||||
dashboard = true
|
||||
|
||||
[ping] # Health check
|
||||
entryPoint = "websecure"
|
||||
|
||||
[http.routers.api]
|
||||
rule = "PathPrefix(`/api`)"
|
||||
service = "api"
|
||||
entryPoints = ["websecure"]
|
||||
|
||||
[http.services.api.loadBalancer]
|
||||
[[http.services.api.loadBalancer.servers]]
|
||||
url = "http://app:${PORT}"
|
||||
|
||||
# Added for websocket
|
||||
[http.services.app.loadBalancer]
|
||||
sticky = true
|
||||
[[http.services.app.loadBalancer.servers]]
|
||||
url = "http://app:${PORT}"
|
||||
|
||||
# Added for websocket
|
||||
[http.routers.app]
|
||||
rule = "Host(`${HOST}`)"
|
||||
entrypoints = ["websecure"]
|
||||
service = "app"
|
||||
|
||||
[http.routers.app.tls]
|
||||
certresolver = "le"
|
||||
|
||||
[http.routers.app.middlewares]
|
||||
# Enable websockets
|
||||
- "websocket"
|
||||
|
||||
[http.middlewares]
|
||||
[http.middlewares.websocket.headers]
|
||||
accessControlAllowHeaders = ["Origin", "Content-Type", "Accept", "Authorization"]
|
||||
accessControlAllowMethods = ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]
|
||||
accessControlAllowOrigin = ["*"]
|
||||
accessControlExposeHeaders = ["Content-Length", "Content-Range"]
|
Reference in New Issue
Block a user