Nginx中配置https中引用http的問題

遇到問題:在使用https頁面中,如果使用http會出因安全問題導致無法訪問,在瀏覽器中的報錯信息如下:

Nginx中配置https中引用http的問題

經測試發現如果用https就會報錯,但是用http就沒有問題。


解決辦法:在nginx的location 正則匹配裡面增加如下:

<code>add_header Content-Security-Policy upgrade-insecure-requests;/<code>

如下:

Nginx中配置https中引用http的問題


分享到:


相關文章: