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