Custom LB algorithm for HTTPS requests

I am using HAProxy for load balancing my HTTPS requests. I would like to know if there is any way to customize the selection of backend server based on the request uri.
to be precise I want something like "uri " algorithm for HTTPS requests

Request URI comes from the client, not from the server.

There is no difference between HTTPS and HTTP, if you terminate SSL on haproxy.

Can we use part of the request uri for generating the hash value ?

eg: original request uri “/help/customer/c1/data/d1”
I want to consider only “/data/d1” for hash generation .

Yes, please read the docs about the balance keyword, specifically the part about uri based load balancing with restricted directory depth.