erupt icon indicating copy to clipboard operation
erupt copied to clipboard

使用 erupt-magic-api 组件,当系统中使用了https时,访问 接口配置页面无法打开

Open cdredfox opened this issue 1 year ago • 3 comments

版本情况

JDK版本:jdk 1.8.0_421-b091
erupt版本: 1.11.7 最新版依然有该问题

问题描述(包括截图)

使用 erupt-magic-api 组件,当系统中使用了https时,访问 接口配置页面无法打开.

  1. 使用环境 erupt 是部署在 k8s 中的一个 pod,k8s 中的 service 的访问地址是:http://aaaaa.com,然后外面请求的时候通过 nginx 转发,是带 https 的。

  2. 堆栈信息

查看浏览器控制台的错误 : magic-api.ftl:38 Mixed Content: The page at 'https://aaaaa.com/#/tpl/magic-api.ftl' was loaded over HTTPS, but requested an insecure frame 'http://aaaaa.com/appdata/magic/web/index.html'. This request has been blocked; the content must be served over HTTPS.

  1. 测试涉及到的文件(注意脱密)

cdredfox avatar Dec 06 '24 02:12 cdredfox

建议换个浏览器试下

erupts avatar Dec 20 '24 17:12 erupts

不是浏览器的问题,而是 nginx 转发时 是 https 的地址,而在 pod 中是 http 的地址,而在 magic-api.ftl 这个页面中,引入的 index.html 是通过 requestContext 直接获取的,所以获取到的是 http 开头的地址,导致无法访问报错。

cdredfox avatar Dec 20 '24 23:12 cdredfox

这种情况发生在:前置网关反向代理了http协议。

aurthurxlc avatar Feb 23 '25 14:02 aurthurxlc

升级到1.12.23版本即可,已针对此场景进行了适配

erupts avatar Aug 07 '25 09:08 erupts