Force TLS on AWS Network Load Balancer on NGINX Ingress of Rancher Kubernetes

1/9/2020

I recently migrated my load balancer on Amazon from Classic Load Balancer to Network Load Balancer. It's automatically created by nginx-ingress from helm. Since the protocol is TCP, I cannot force SSL anymore, there's no header like X-Forwarded-Proto to detect, so any script like

if ($http_x_forwarded_proto = 'http') { return 301 https://$host$request_uri; }

doesn't work anymore.

Is there anyway to force SSL/TLS on nginx-ingress or any config could help on Amazon Network Balancer?

Thanks a lot!

-- Aperture Prometheus
amazon-web-services
kubernetes
nginx
rancher

0 Answers