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

使用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。

 

posted @ 2022-03-14 18:07  默读自我  阅读(1143)  评论(0)    收藏  举报