<p>I have the following that config that works when I try <code>&lt;NodeIP&gt;:30080</code></p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: app-deployment
spec:
  replicas: 3
  template:
    metadata:
      labels:
        name: app-node
    spec:
      containers:
        - name: app
          image: myregistry.net/repo/app:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          env:
            - name: NODE_ENV
              value: production
---
apiVersion: v1
kind: Service
metadata:
  name: app-service
spec:
  selector:
    name: app-node
  ports:
    - protocol: TCP
      port: 80
      targetPort: 8080
      nodePort: 30080
  type: NodePort
</code></pre>

<p>I am trying to use an Ingress:</p>

<pre><code> apiVersion: extensions/v1beta1
 kind: Ingress
 metadata:
   name: nginx-ingress
 spec:
   rules:
   - host: myhost.com
     http:
       paths:
       - path: /app
         backend:
           serviceName: app-service
           servicePort: 80
</code></pre>

<p><code>myhost.com</code> works with the nginx intro screen, but <code>myhost.com/app</code> gives <code>404 Not Found</code>. Where is the issue in my setup?</p>

<hr>

<p>UPDATE:</p>

<pre><code>   - path: /
     backend:
       serviceName: app-service
       servicePort: 80
</code></pre>

<p>If I do root path it works, but how come <code>/app</code> doesn't?</p>

atkayla
<p>Your ingress definition creates rules that proxy traffic from the <code>{path}</code> to the <code>{backend.serviceName}{path}</code>. In your case, I believe the reason it's not working is that <code>/app</code> is proxied to <code>app-service:80/app</code> but you're intending on serving traffic at the <code>/</code> root. Try adding this annotation to your ingress resource: <code>nginx.ingress.kubernetes.io/rewrite-target: /</code></p>

<p>Source: <a href="https://github.com/kubernetes/ingress-nginx/tree/master/docs/examples/rewrite" rel="noreferrer">https://github.com/kubernetes/ingress-nginx/tree/master/docs/examples/rewrite</a></p>
