为ingress配置增长注解(annotations):nginx.ingress.kubernetes.io/ssl-redirect: 'true' 就能够实现http强制跳转至httpsnginx
不过默认状况ingress是经过308重定向跳转到https, ie浏览器不必定支持308状态, 能够经过以下方式修改ingress配置,让ingress经过301跳转到httpsgit
一、进入阿里容器服务后台->选择配置项github
二、为ingress配置项添加 http-redirect-code = 301 配置。浏览器
参考下配置项的文档:https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/ide
从上图能够看到这个重定向默认值是 “308”,k8s路由默认http跳转到https, 用的是308跳转,ie浏览器,或者有些低版本的浏览器不支持“308”跳转的,要改为“301”跳转,否则低版本的浏览器会报错。ui