Reputation: 491
I have attached AWS ACM provided SSL certificate to NLB. NLB will forward request to nginx ingress. Nginx is giving me the following error. The plain HTTP request was sent to HTTPS port
.
I have set the following annotation in nginx ingress.
I have set following annotation in nginx ingress service which is running behind NLB.
Upvotes: 3
Views: 9278
Reputation: 1
- name: http
nodePort: 30192
port: 80
protocol: TCP
targetPort: http
- name: https
nodePort: 30429
port: 443
protocol: TCP
targetPort: https
Upvotes: -1
Reputation: 30083
For this error :
The plain HTTP request was sent to HTTPS port
Change your port configuration in Nginx service like, your target port in HTTPS section should be http instead of https
ports:
- name: https
**targetPort: http**
Here the annotation for reference
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: tcp
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "60"
service.beta.kubernetes.io/aws-load-balancer-cross-zone-load-balancing-enabled: "true"
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:ap-southeast-1:xxxxxxx:certificate/8991ftt8-69e0-4e7d-1164-yy0aae19da90v
service.beta.kubernetes.io/aws-load-balancer-type: nlb
Upvotes: 5