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。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM