add traefik sticky session cookie
All checks were successful
continuous-integration/drone/push Build is passing

this helps traefik route clients to the backend servers they established
connections with initially, keeping the sessions alive properly

ref: https://doc.traefik.io/traefik/routing/services/#sticky-sessions
ref: https://stackoverflow.com/a/64711374
This commit is contained in:
surtur 2021-02-22 13:39:03 +01:00
parent 7abdd05701
commit 80554d9da9
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -11,6 +11,10 @@ services:
labels:
traefik.enable: true
traefik.http.services.netcoreultimateapp-prod.loadbalancer.server.port: 80
traefik.http.services.netcoreultimateapp-prod.loadbalancer.sticky.cookie: true
traefik.http.services.netcoreultimateapp-prod.loadbalancer.sticky.cookie.name: lb-session_pwt
traefik.http.services.netcoreultimateapp-prod.loadbalancer.sticky.cookie.secure: true
traefik.http.services.netcoreultimateapp-prod.loadbalancer.sticky.cookie.httpOnly: true
traefik.http.routers.netcoreultimateapp-prod.rule: Host(`localhost`) || Host(`127.0.0.1`) || Host(`netcoreultimateapp-prod`) || Host(`pwt`)
logging:
driver: json-file