<p>Sorry i'm new to all that, i have 2 springboot app deployed and exposed (using services) which i can reach using &lt; Minikube IP >:&lt; Port > and i want to use ingress to expose the apps.</p>

<p>I've this ingress config to expose 2 kubernetes services.</p>

<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: esse-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
 rules:
 - host: mssmdns.dz
   http:
     paths:
     - path: /esse-1/*
       backend:
         serviceName: esse-service-1
         servicePort: 8080
     - path: /esse-2/*
       backend:
         serviceName: esse-service-2
         servicePort: 8080
</code></pre>

<p>I want to redirect incoming request as follow:</p>

<p><a href="http://mssmdns.dz/esse-1/a/b/c" rel="nofollow noreferrer">http://mssmdns.dz/esse-1/a/b/c</a> (from outside) <strong>-></strong> <a href="http://mssmdns.dz/a/b/c" rel="nofollow noreferrer">http://mssmdns.dz/a/b/c</a> (inside the app)</p>

<p>(and same for esse-2).</p>

<p>When i write any url i'm being stuck in the same page (the / url)
I'm using kubernetes and nginx as ingress controller.</p>

<p>thanks in advance</p>

Mssm
<p>The <a href="https://github.com/kubernetes/ingress-nginx/" rel="nofollow noreferrer">ingress-nginx</a> documentation provides an <a href="https://kubernetes.github.io/ingress-nginx/examples/rewrite/" rel="nofollow noreferrer">example rewrite configuration</a>.</p>

<p>It uses regular expressions on the path and then uses the second matching group from the regex in the <code>rewrite-target</code> annotation. </p>

<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: esse-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
 rules:
 - host: mssmdns.dz
   http:
     paths:
     - path: /esse-1(/|$)(.*)
       backend:
         serviceName: esse-service-1
         servicePort: 8080
     - path: /esse-2(/|$)(.*)
       backend:
         serviceName: esse-service-2
         servicePort: 8080
</code></pre>
