If you need to use Nginx open source, the "closest" solutions are based on IP addresses IP Hash or user-defined variables hash.
If you want to use session persistence, which seems to be the case, check out the Nginx PLUS documentation where some examples of "stickiness" with cookies are present.