HAProxy configuration Headers redirect to the correct shard

Hello!

I am facing some issues/have some questions.
Currently I am setting up a Non-Profit Videoconferencing System for the schools in my area because of their lacking digitalization. For that I am using Jitsi Meet.
I have multiple Shards, each of them is a working system for itself. With HAProxy I want to balance the load onto them.

The issue is: When I start the room “test”, it sends me to server2 e.g… When I want to join the room using the main domain which routs to haproxy, it sends me to server3 e.g… The goal is to land on the same shard so the room doesnt coexist on multiple shards and the users join in the correct one.

My idea was to assign a HTTP-Header to each one, for example “x-SERVERID server1”, “x-SERVERID server2” and this gets mapped into a stick table. The headers will be configured in the nginx conf of the single shards then. But unfortunatly I dont got an idea how that could look like.

If you got questions please ask me! I am doing this for the schools in my area and because of the floods in Germany the schools here get probably closed again and I want to help them out there.

Thanks in advance!