Root_url to custom path is not working with reverse HaProxy / Grafana

I am trying to use HAProxy to proxy to Grafana with end point ‘/grafana’. For that I happened to change root_url in my ini file to " root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana/ "

I tried to invoke Grafana endpoint with these settings

frontend HTTP-in
  use_backend grafana_backend if  { path_beg /grafana/ }
backend grafana_backend
http-request set-path %[path,regsub(^/grafana/?,/)]

but those solutions do not seem to work for me with HAProxy.