Kodbox开启https后无法访问的解决方法

使用docker运行kodbox后打开安装界面只有界面没有css,js,控制台显示。

Mixed Content: The page at 'https://domain.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://domain.com/static/style/dist/main.css?v=1.42.01'. This request has been blocked; the content must be served over HTTPS.

解决方法:

在反向代理配置文件里加入 add_header Content-Security-Policy upgrade-insecure-requests; 强制加载https即可。

location ^~ / {
    ...
    add_header Content-Security-Policy upgrade-insecure-requests;
}