ingress 400 Bad Request The plain HTTP request was sent to HTTPS port

ingress 400 Bad Request The plain HTTP request was sent to HTTPS port_第1张图片

 

问题现象

        访问时返回400 Bad Request,并提示The plain HTTP request was sent to HTTPS port

问题原因

        Ingress Controller到后端Pod请求使用了默认的HTTP请求,但后端是HTTPS服务。。

解决方案

        添加注释,让其使用https请求

nginx.ingress.kubernetes.io/backend-protocol:"HTTPS"

官方配置:Annotations - NGINX Ingress Controller

此问题在nginx配置中也出现过,解决方法

proxy_pass https://xxx;


 

你可能感兴趣的:(k8s学习之路,nginx,kubernetes)