


可参考如下两个解决方法:
1、推荐修改程序,将程序中所有http调用都改成https即可,若不会修改,可联系程序开发商协助处理。
2、若不方便修改程序,可在header中加入 Upgrade-Insecure-Requests,会告诉浏览器可以把所属本站的所有 http 连接升级为 https 连接,外站请求保持默认
IIS7/IIS8/IIS10添加header方法:

若不能调整IIS设置,可直接在网站根目录web.config中定义:
Apache设置header方法:可直接在网站根目录.htaccess中定义<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Content-Security-Policy" value="upgrade-insecure-requests" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
Nginx设置header方法:<IFModule mod_headers.c>
Header add Content-Security-Policy upgrade-insecure-requests
</IFModule>
server {
listen 80;
server_name (myservername);
add_header Content-Security-Policy "upgrade-insecure-requests";
location / {
proxy_pass http://localhost:5000;
}
}



亲爱的:若该文章解决了您的问题,可否收藏+评论+分享呢?
文章评论 本文章有个评论