https://github.com/longbridge/traefik-session-max-age
https://github.com/longbridge/traefik-session-max-age
traefik traefik-plugin
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/longbridge/traefik-session-max-age
- Owner: longbridge
- License: apache-2.0
- Created: 2023-10-04T02:48:32.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-10-04T09:52:32.000Z (over 2 years ago)
- Last Synced: 2025-06-04T22:29:40.067Z (about 1 year ago)
- Topics: traefik, traefik-plugin
- Language: Go
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
This repository includes traefik plugin which sets sticky session cookie's max age.
### Configuration
For traefik plugin, static configuration must define the module name (as is usual for Go packages).
The following declaration (given here in YAML) defines a plugin:
```yaml
# Static configuration
experimental:
plugins:
session-max-age:
moduleName: github.com/longbridgeapp/traefik-session-max-age
version: v0.1.0
```
Here is an example of a file provider dynamic configuration (given here in YAML), where the interesting part is the `http.middlewares` section:
```yaml
# Dynamic configuration
http:
routers:
my-router:
rule: host(`demo.localhost`)
service: service-foo
entryPoints:
- web
middlewares:
- session-max-age
services:
service-foo:
loadBalancer:
servers:
- url: http://127.0.0.1:5000
middlewares:
session-max-age:
plugin:
session-max-age:
cookieName: traefik_cookie
maxAge: 100000
```