<p>I have a <a href="https://min.io/" rel="nofollow noreferrer">Minio</a> ClusterIP service running in a Kubernetes cluster. And on top of it, I have a <a href="https://kubernetes.github.io/ingress-nginx/" rel="nofollow noreferrer">NGINX Ingress Controller</a>. NGINX Ingress needs to forward Minio traffic to the Minio service, and other traffic to their corresponding services.</p>

<p>My Ingress configuration looks like this:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
    - http:
        paths:
          - path: /app/?(.*)
            backend:
              serviceName: app-service
              servicePort: 3000
          - path: /minio/?(.*)
            backend:
              serviceName: minio-service
              servicePort: 9000
</code></pre>

<p>Once deployed, the app works fine. However, the Minio page has problem, complaining:</p>

<pre><code>This page isn’t working
example.mysite.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS
</code></pre>

<p>And indeed, the requests are kept redirecting. Here is the screenshot from Chrome DevTools' Network console.</p>

<p><img src="https://i.stack.imgur.com/3kNRy.png" width="400" /></p>

<p>Any ideas?</p>

Yuci
<p>As Minio always redirects to /minio/, you need to keep <code>/minio</code> in the path and pass it on to the Minio service.</p>

<p>When I change its path rule to <code>- path: /(minio/.*)</code>, it works. Now the Ingress configuration looks like below:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
    - http:
        paths:
          - path: /app/?(.*)
            backend:
              serviceName: app-service
              servicePort: 3000
          - path: /(minio/.*)
            backend:
              serviceName: minio-service
              servicePort: 9000
</code></pre>

<p>And I've got the Minio service working in the browser:</p>

<p><img src="https://i.stack.imgur.com/o2LO5.png" width="200" /></p>

<p>Hope it is helpful.</p>
