使用nginx代理后端服务时出现如下错误:

Mixed Content: The page at ‘https://xxx’ was loaded over HTTPS, but requested an insecure stylesheet ‘http://xxx’. This request has been blocked. the content must be served over HTTPS.

错误原因:

nginx代理的https页面中加载的内容使用的http协议导致报错。

解决方法:

增加add_header Content-Security-Policy "upgrade-insecure-requests"将http协议升级为https。

更多推荐

nginx代理服务报Mixed Content: The page at ‘https://xxx.com‘ was loaded over HTTPS