Add ability for sticky sessions to backend resource.#511
Conversation
| } | ||
| } | ||
| } | ||
| : {}) |
There was a problem hiding this comment.
I don't think we can use the cookie in the raw tcp/udp section because there is not a http cookie to set. Is that right? I think we want hashing here.
There was a problem hiding this comment.
Good catch! 🤜🏻💥🤛🏻
Modified it to create a hash based off source IP + ephemeral port, which should account for multiple devices behind the same NAT. (server would see public IP + ephemeral port and sticky based on the hash of that). Will push a new PR shortly.
|
This is awesome thanks for tackling this! Some thoughts on the UI: I think it might not make sense to lump enabling or disabling SSL in with the advanced options. Not sure how @miloschwartz might feel about that? Maybe it makes more sense to make a new section toward the bottom under the targets called advanced and leave ssl where it was? I am also thinking it might make sense to hide this option unless they have more than one target? Not committed to this one. |
|
Love the comment about making it appear once a user inputs more than one target. I'm terrible at design though. I'll make it behave that way, stick it somewhere at the bottom, below the targets, which shouldn't be hard to position in a more visually pleasing location/manner. |
x86txt
left a comment
There was a problem hiding this comment.
Added two requested changes, please review.
|
Getting to this soon we promise! Thanks for the hard work! |
|
Thank you @x86txt! Sorry this took so long for us to merge. |
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.
How to test?
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.