问题描述:
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 的 proxy 配置部分,如下所示:
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
add_header Content-Security-Policy upgrade-insecure-requests;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;