简体   繁体   English

ERR_TOO_MANY_REDIRECTS 通过 NGINX 入口控制器用于 Minio

[英]ERR_TOO_MANY_REDIRECTS for Minio via NGINX Ingress Controller

I have a Minio ClusterIP service running in a Kubernetes cluster.我有一个Minio在Kubernetes集群ClusterIP服务运行。 And on top of it, I have a NGINX Ingress Controller .最重要的是,我有一个NGINX Ingress Controller NGINX Ingress needs to forward Minio traffic to the Minio service, and other traffic to their corresponding services. NGINX Ingress 需要将 Minio 流量转发到 Minio 服务,其他流量转发到对应的服务。

My Ingress configuration looks like this:我的 Ingress 配置如下所示:

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

Once deployed, the app works fine.部署后,该应用程序运行良好。 However, the Minio page has problem, complaining:但是,Minio 页面有问题,抱怨:

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

And indeed, the requests are kept redirecting.事实上,请求一直在重定向。 Here is the screenshot from Chrome DevTools' Network console.这是 Chrome DevTools 的网络控制台的屏幕截图。

Any ideas?有任何想法吗?

As Minio always redirects to /minio/, you need to keep /minio in the path and pass it on to the Minio service.由于 Minio 总是重定向到 /minio/,您需要将/minio保留在路径中并将其传递给 Minio 服务。

When I change its path rule to - path: /(minio/.*) , it works.当我将其路径规则更改为- path: /(minio/.*) ,它可以工作。 Now the Ingress configuration looks like below:现在 Ingress 配置如下所示:

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

And I've got the Minio service working in the browser:我让 Minio 服务在浏览器中运行:

Hope it is helpful.希望它有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM