<p>when I hit xyz.abc.com/login it should go to test service and when I hit URL xyz.abc.com/(anything) it should go to test1 service but currently, when I hit xyz.abc.com/login it is not going there but going to test1 service random.com/login, so to go to path-based routing in NLB
so how to achieve this scenario
anyone can help?</p>
<pre><code>kind: Ingress
apiVersion: extensions/v1beta1
metadata:
  name: test
  namespace: test
  labels:
    app.kubernetes.io/managed-by: Helm
  annotations:
    cert-manager.io/cluster-issuer: letsencrypt-prod
    kubernetes.io/ingress.class: internet-facing-ingress
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/server-snippet: &gt;
      rewrite /login(.*) /v2/login/ break; rewrite / / break;

      rewrite /integration/customer(.*) /v1/integration/customer$1; break;

      rewrite /admin/customer(.*) /v2/admin/customer$1; break;

      rewrite /admin/abc1(.*) /v2/admin/abc1$1;
      break;
spec:
  tls:
    - hosts:
        - xyz.abc.com
      secretName: serverv1-tls
  rules:
    - host: xyz.abc.com
      http:
        paths:
          - path: /login
            backend:
              serviceName: test
              servicePort: 80
          - path: /
            backend:
              serviceName: test1
              servicePort: 80
</code></pre>
<p>external service:</p>
<pre><code>kind: Service
apiVersion: v1
metadata:
  name: test1
  namespace: test1
spec:
  type: ExternalName
  sessionAffinity: None
  externalName: random.com
status:
  loadBalancer: {}
</code></pre>

<p>in path just try by adding <code>/login/</code> <strong>/</strong> at last</p>
<pre><code>rules:
        - host: xyz.abc.com
          http:
            paths:
              - path: /login/
                backend:
                  serviceName: test
                  servicePort: 80
              - path: /
                backend:
                  serviceName: test1
                  servicePort: 80
</code></pre>
<p>the easiest way is to separate out ingresses if possible.</p>
