Custom url to access grafana through ingress gateway

Hi All,
I have installed istio through istioctl and i am trying to access grafana through ingress gateway. I am able to access the grafana using www.example.com through my lb. Grafana has context root as / and i have defined a virtual service to forward the request. Now i wanted to change the context root to www.example.com/grafana. How do i achieve this? I get the below error when i modify the context root

If you’re seeing this Grafana has failed to load its application files

  1. This could be caused by your reverse proxy settings.

  2. If you host grafana under subpath make sure your grafana.ini root_url setting includes subpath

  3. If you have a local dev build make sure you build frontend using: yarn start, yarn start:hot, or yarn build

  4. Sometimes restarting grafana-server can help

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: grafana-gateway
  namespace: istio-system
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: grafana-vts
  namespace: istio-system
spec:
  hosts:
  - "*"
  gateways:
  - grafana-gateway
  http:
  - match:
    - uri:
        prefix: /graphana/
    - uri:
        prefix: /grafana
    rewrite:
      uri: /
    route:
    - destination:
        host: grafana.istio-system.svc.cluster.local
        port:
          number: 3000

can someone help me please

I was able to get it running with istio 1.6.5:

The kind: IstioOperator for installation:

    grafana:
      enabled: true
      env:
        GF_SERVER_ROOT_URL: "%(protocol)s://%(domain)s/grafana/"
        GF_SERVER_DOMAIN: "example.com"
        GF_SERVER_SERVE_FROM_SUB_PATH: "false"

And a VirtualService:

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: vs-metrics
spec:
  hosts:
    - example.com
  gateways:
    - ingress-gateway
  http:
    - name: metrics-route
      match:
        - uri:
            prefix: /grafana/
      rewrite:
        uri: /
      route:
        - destination:
            host: grafana.istio-system.svc.cluster.local
            port:
              number: 3000