nginx Digital Ocean负载均衡器-普通HTTP请求发送到HTTPS端口

7nbnzgx9  于 4个月前  发布在  Nginx
关注(0)|答案(1)|浏览(52)

我正在使用Nginx Ingress Controller(不带 Helm )设置DO负载均衡器来访问我的服务。从DO控制面板,我可以看到我的节点正在接受流量,页面向我抛出400错误请求,错误为The plain HTTP request was sent to HTTPS port。可以指出我的错误吗?


的数据
我想知道这是否与我的health checks有关?应用程序正在暴露一个端点以更新健康检查200,但应用程序通过端口3000暴露,健康检查URL指向80 atm。
下面是我的LB的annontation使用。

annotations:
    service.beta.kubernetes.io/do-loadbalancer-name: random
    service.beta.kubernetes.io/do-loadbalancer-protocol: "http"
    service.beta.kubernetes.io/do-loadbalancer-tls-passthrough: "true"
    service.beta.kubernetes.io/do-loadbalancer-tls-ports: "443"
    service.beta.kubernetes.io/do-loadbalancer-certificate-id: "masked-my-cert-id"
    service.beta.kubernetes.io/do-loadbalancer-disable-lets-encrypt-dns-records: "false"
    service.beta.kubernetes.io/do-loadbalancer-redirect-http-to-https: "true"
    service.beta.kubernetes.io/do-loadbalancer-healthcheck-port: "3000"
    service.beta.kubernetes.io/do-loadbalancer-healthcheck-protocol: "http"
    service.beta.kubernetes.io/do-loadbalancer-healthcheck-path: "/api/healthcheck"
    service.beta.kubernetes.io/do-loadbalancer-healthcheck-check-interval-seconds: "3"
    service.beta.kubernetes.io/do-loadbalancer-healthcheck-response-timeout-seconds: "5"
    service.beta.kubernetes.io/do-loadbalancer-healthcheck-unhealthy-threshold: "3"
    service.beta.kubernetes.io/do-loadbalancer-healthcheck-healthy-threshold: "5"

字符串
FYR截图


dwbf0jvd

dwbf0jvd1#

解决了我的问题。我需要为我的Ingress暴露端口443。我通过设置TLS做到了这一点。
这就是我的最终LB设置看起来像

的样子

相关问题