title: URL Regex match for Istio- VirtualService throwing 404
body: <p>My Gateway and VirtualService for the sample BookInfo looks like this:</p>
  <pre><code>apiVersion: networking.istio.io/v1alpha3
  kind: Gateway
  metadata:
    name: bookinfo-gateway
  spec:
    selector:
      istio: ingressgateway # use istio default controller
    servers:
    - port:
        number: 80
        name: http
        protocol: HTTP
      hosts:
      - &quot;*&quot;
      tls:
        httpsRedirect: true
    - port:
        number: 443
        name: https
        protocol: HTTPS
      hosts:
      - &quot;*&quot;
      tls:
        mode: SIMPLE 
        serverCertificate: /etc/istio/ingressgateway-certs/tls.crt
        privateKey: /etc/istio/ingressgateway-certs/tls.key
  ---
  apiVersion: networking.istio.io/v1alpha3
  kind: VirtualService
  metadata:
    name: bookinfo
  spec:
    hosts:
    - &quot;*&quot;
    gateways:
    - bookinfo-gateway
    http:
    - match:
      - uri:
          exact: /productpage
      - uri:
          prefix: /static
      - uri:
          exact: /login
      - uri:
          exact: /logout
      route:
      - destination:
          host: productpage
          port:
            number: 9080
    - match:
      - uri:
          regex: &quot;v1&quot;
      route:
      - destination:
          host: productpage
          port:
            number: 9080
  </code></pre>
  <p>I am terminating TLS at the gateway and in the HTTP route, I have configured a regex match on &quot;v1&quot; for HTTP and routing it the productpage service.</p>
  <p>I am testing this by sending a request to <code>http://External-IP/api/v1/products</code> (the sample application's productpage service is configured to return a text body on this endpoint), but the request fails with HTTP 404. I am not sure what I am doing wrong here, any help is highly appreciated.</p>