Add ability for sticky sessions to backend resource. #1618

Closed
opened 2026-04-05 19:37:35 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @x86txt on 4/11/2025

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

Allow 'sticky sessions' to backend resources. This is required if there are multiple targets and the targets aren't stateless, like the VNC console sessions to Proxmox. This keep the user pinned to a single target for the duration of their session.

image

How to test?

mkdir -p /tmp/server1 && echo "server1" > /tmp/server1/index.html && \
mkdir -p /tmp/server2 && echo "server2" > /tmp/server2/index.html && \
python3 -m http.server 10000 --bind 0.0.0.0 --directory /tmp/server1 && \
python3 -m http.server 20000 --bind 0.0.0.0 --directory /tmp/server2

Add two targets as shown in the screenshot below. Browse to your Resource and hit refresh and notice the webpage rotates from server1 to server 2, etc. Enable Sticky Sessions, hit refresh several more times, and notice that Traefik now keeps your session pinned to a single target.

image

*Originally created by @x86txt on 4/11/2025* ## Community Contribution License Agreement By creating this pull request, I grant the project maintainers an unlimited, perpetual license to use, modify, and redistribute these contributions under any terms they choose, including both the AGPLv3 and the Fossorial Commercial license terms. I represent that I have the right to grant this license for all contributed content. ## Description Allow 'sticky sessions' to backend resources. This is required if there are multiple targets and the targets aren't stateless, like the VNC console sessions to Proxmox. This keep the user pinned to a single target for the duration of their session. ![image](https://github.com/user-attachments/assets/475826e4-95fe-4e79-8596-779ba8a7dc37) ## How to test? ```shell mkdir -p /tmp/server1 && echo "server1" > /tmp/server1/index.html && \ mkdir -p /tmp/server2 && echo "server2" > /tmp/server2/index.html && \ python3 -m http.server 10000 --bind 0.0.0.0 --directory /tmp/server1 && \ python3 -m http.server 20000 --bind 0.0.0.0 --directory /tmp/server2 ``` Add two targets as shown in the screenshot below. Browse to your Resource and hit refresh and notice the webpage rotates from server1 to server 2, etc. Enable Sticky Sessions, hit refresh several more times, and notice that Traefik now keeps your session pinned to a single target. ![image](https://github.com/user-attachments/assets/df681ecd-05e6-4261-aa2c-95ce256cf882)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#1618