<p>I'm using Nginx-ingress-controller
this is the yaml file for ingress:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
  labels:
    app: ingress-resource
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
spec:
  defaultBackend:
    service:
      name: hello-kubernetes-first
      port:
        number: 80
  rules:
    - host: testk8s.com
      http:
        paths:
          - path: /test
            pathType: Prefix
            backend:
              service:
                name: backend-service
                port:
                  number: 8001

</code></pre>
<p>when I do reach <code>testk8s.com/test</code> I'm getting <code>Cannot GET /test</code>
and when do reach <code>testk8s.com</code> default backend works.</p>

Abd allah Khateeb
<p>Try this once</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minimal-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  ingressClassName: nginx
  defaultBackend:
  service:
    name: hello-kubernetes-first
    port:
      number: 80
  rules:
  - http:
      paths:
      - path: /test
        pathType: Prefix
        backend:
          service:
            name: backend-service
            port:
              number: 80
</code></pre>
