Nginx https访问http问题

Nginx https访问http问题

https访问http,nginx会出现以下问题:

Mixed Content: The page at 'https://www.xxx.com/' was loaded over HTTPS, but requested an insecure script 'http://www.xxx.com/a.js'. This request has been blocked; the content must be served over HTTPS.

解决方法有两种:

一:

修改nginx配置在server里添加头部:

add_header Content-Security-Policy upgrade-insecure-requests;

二:

可以让开发修改代码,让https可以访问http。

 

发表回复 0

Your email address will not be published. Required fields are marked *