使用nginx代理后端服务时出现如下错误:
Mixed Content: The page at 'https://mydomain.com' was loaded over HTTPS, but requested an insecure stylesheet 'http://mydomain.com'. 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。