Stick on url_param

Hello. I would like to ask if it is possible to stick to individual server based on url_param?

I have HAProxy load balancer and couple of proxies as a backend. I would like to stick to one of the backend proxies if the url_param is matching with one stored in stick table.

I have config file:

frontend testfrontend
        bind IP:PORT
        default_backend proxies
backend proxies
        stick-table type string size 1m expire 1h
        stick on url_param(session_id) table proxies
        stick store-request url_param(session_id) table proxies
        http-request set-uri '%[url,regsub("^(.*)(&|\?)session_id[^&]*(?:&|$)(.*)",\1\2\3)]'

        # Hosts
        server host1 IP:PORT check
        server host2 IP:PORT check
        server host3 IP:PORT check
        server host4 IP:PORT check

It should now stick to session on matching url param but it doesn’t and instead it is cycling through proxies.

The issue here were in link definition. As the front-end isn’t secured by SSL cert so it can handle only insecure traffic (http).

The working config:

frontend frontend
        bind localIP:Port
        stick-table type string size 1m expire 1h
        acl has_session_id url_param(session_id) -m found
        use_backend proxies if has_session_id

backend proxies
        stick on url_param(session_id) table frontend
        stick store-request url_param(session_id) table frontend

        # Hosts
        server host1 IP:PORT check
        server host2 IP:PORT check
        server host3 IP:PORT check
        server host4 IP:PORT check

it only works on insecure connections: curl -x IP:PORT "http://HOSTNAME.com?session_id=123"