title: K8s ingress for path based routing for multiple services
body: <p>I am using nginx ingress for path based routing for multiple services .</p>
  <p>My services output</p>
  <pre><code>NAME                                 TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)                      
  
  ingress-nginx-controller             LoadBalancer   X.X.X.33    X.X.X.112   80:30853/TCP,443:31386/TCP   
  ingress-nginx-controller-admission   ClusterIP      X.X.X.139   &lt;none&gt;           443/TCP                      
  
  test1                         ClusterIP      X.X.X.197   &lt;none&gt;           9080/TCP                     
  test2                         ClusterIP      X.X.X.30    &lt;none&gt;           9995/TCP                     
  </code></pre>
  <p>My ingress.yaml file</p>
  <pre><code>apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    name: ingress-resource
    annotations:
      nginx.ingress.kubernetes.io/rewrite-target: &quot;/&quot;
  spec:
    rules:
    - http:
        paths:
        - path: /test2
          backend:
            serviceName: test2
            servicePort: 9995
        - path: /test1
          backend:
            serviceName: test1
            servicePort: 9080
  </code></pre>
  <p>and kubectl ingress output</p>
  <pre><code>NAME               HOSTS   ADDRESS   PORTS   AGE
  ingress-resource   *                 80      45m
  </code></pre>
  <p>When i am trying to access service from outside cluster -
  I am getting 404</p>
  <pre><code>-&gt; http:// X.X.X.112/test1 return 404
  -&gt; http:// X.X.X.112/test2 return 404 
  
  Where  X.X.X.112 is external ip of ingress-nginx-controller
  </code></pre>
  <p>-&gt; When I create ingress to services running on port 8080, it seems to be working fine.
  What the issue ?</p>