<p>I have istio configuration on which the docker container runs jasperreports on tomcat(<a href="https://hub.docker.com/r/bitnami/jasperreports/" rel="nofollow noreferrer">bitnami jasperreports</a>). the application itself could be accessed with context path at http://IP:8080/jasperserver.</p>
<p>I am planning to use istio in my kubernetes configuration, expose the service using http gateway and virtual service. can I add context path of &quot;jasperserver&quot; in addition to destination host and port number in virtual service configuration?</p>
<p>here is my current virtualservice configuration</p>
<pre><code>apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: http-gateway
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - &quot;*&quot;
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: jasper-virtual-services  
spec:
  hosts:
  - &quot;*&quot;
  gateways:
  - http-gateway
  http:
  - match:
    - uri:
        exact: /report
    
    route:
    - destination:
        host: jasperserver.reporting.svc.cluster.local
        port:
          number: 80
</code></pre>

Yuyanto
<p>You are probably looking for <a href="https://istio.io/latest/docs/reference/config/networking/virtual-service/#HTTPRewrite" rel="nofollow noreferrer">rewrites</a></p>
<p>Something like</p>
<pre><code>  http:
  - match:
    - uri:
        exact: /report
    rewrite:
      uri: /jasperserver
</code></pre>
