自定义K8S nginx ingress 重定向
背景描述
一个前端工程,此前采用的方案是:
Nginx反向代理 + Docker 应用服务;
后面统一升级为K8S方案:
SLB + Nginx Ingress + K8s deployment
迁移后,出现浏览器空白,控制台报错:
Mixed Content: The page at ‘https://a.com’ was loaded over HTTPS, but requested an insecure resource ‘http://a.com’. This request has been blocked; the content must be served over HTTPS.

kubernetes nginx ingress 301 was loaded over HTTPS, but requested an insecure frame
问题定位

具体问题就是,301重定向时,没有指定为https
此前Nginx反向代理配置为:

本文介绍了一种前端工程从Nginx反向代理迁移到K8S Nginx Ingress过程中遇到的301重定向问题,并提供了通过添加特定注解来确保重定向使用HTTPS的解决方案。
最低0.47元/天 解锁文章
1207

被折叠的 条评论
为什么被折叠?



