Digital Ocean Load Balancer - The plain HTTP request was sent to HTTPS port

202 views Asked by At

I'm setting up DO Load Balancer to access my service using Nginx Ingress Controller (without helm). From DO control panel, I can see my nodes are accepting traffic somehow the page throws me 400 bad request with error The plain HTTP request was sent to HTTPS port. Can one please point me out my mistake?

enter image description here

I wonder if this has anything to do with my health checks? The application is exposing an endpoint to update health check 200, but application expose via port 3000 and health check URL is pointing to 80 atm.

Below's the annontation use for my LB.

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"

Screenshot FYR

enter image description here

1

There are 1 answers

0
Tommy Leong On BEST ANSWER

Resolved my issue. I need to expose port 443 for my Ingress. I did this by setting up the TLS.

This is how my final LB setup looks like enter image description here