我有客户在我提供的页面上使用 HTML。该 HTML 链接到我服务器上的文件(JS、CSS、图像等)。
我给他们的例子:
<link type="text/css" rel="stylesheet" href="http://www.example.org/this.css" />
我刚刚获得了 SSL,所以我的网站现在是 http s。然而,当从我的服务器请求文件时,我给他们的服务器上的 HTML 仍然是 http。
因此,他们收到混合内容警告并且内容被阻止。像这样:
混合内容:“ https://www.example.org/ ”上的页面通过 HTTPS 加载,但请求了不安全的样式表“ http://www.example.org/file.css ”。此请求已被阻止;内容必须通过 HTTPS 提供。
我不能让我的所有客户将他们所有页面上的所有链接都更改为“http s ”,以便防止警告/阻塞。那将是一场噩梦。
我的主人是 GoDaddy。我的服务器是 Windows 服务器,IIS:7.0,ASP.Net 运行时版本:4.0/4.5。
我怎样才能通过 web.config 解决这个问题?我目前的规则是:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="HTTP to HTTPS redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
我想要发生的是允许所有外部 http 请求到我的 https 服务器。
谢谢!
我正在使用Cloudflare 的自定义域名(https://thebotspeaks.com)托管我的git-hub pages网站(peps09791.github.io).要启用HTTPS,我已完成以下配置:
在我的_config.yaml文件中,我已相应地设置了URL密钥
网址:" https://peps0791.github.io "
在我的cloudFlare仪表板中,我启用了HTTPS重写选项以防止混合内容错误.
我还从CloudFlare启用了灵活SSL.
我没有启用默认的HTTPS重定向,因为网站突破了HTTPS.在HTTP上,它工作正常.
现在,当我尝试使用HTTPS访问我的网站时,我收到混合内容错误:
混合内容:" https://thebotspeaks.com/ " 页面是通过HTTPS加载的,但请求了一张不安全的图片" http://thebotspeaks.com/assets/images/bio-photo.jpg ".此内容也应通过HTTPS提供.
09:54:45.323(索引):1混合内容:" https://thebotspeaks.com/ " 页面是通过HTTPS加载的,但请求了一个不安全的样式表' http://thebotspeaks.com/assets/css/main .css '.此请求已被阻止; 内容必须通过HTTPS提供.
09:54:45.785(索引):1混合内容:" https://thebotspeaks.com/ " 页面是通过HTTPS加载的,但请求了一个不安全的脚本" http://thebotspeaks.com/assets/js/main .min.js '.此请求已被阻止; 内容必须通过HTTPS提供.
从控制台,我可以看到:
<script src="https://peps0791.github.io/assets/js/main.min.js"></script>
<link rel="stylesheet" href="https://peps0791.github.io/assets/css/main.css">
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
我们在Magento商店的购物车页面上收到了大量混合内容错误
Mixed Content: The page at 'https://www.magento.com/onestepcheckout/index/' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Lato:400,300,700,900'. This request has been blocked; the content must be served over HTTPS.
Run Code Online (Sandbox Code Playgroud)
我可以看到google字体文件是通过http在我们主题的head部分调用的
<link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
Run Code Online (Sandbox Code Playgroud)
我想知道如果我将上面的行更改为以下是解决此问题的最佳方法是什么:
选项1
<link href='https://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
Run Code Online (Sandbox Code Playgroud)
或 选项2
<link href='//fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
Run Code Online (Sandbox Code Playgroud)
考虑到我们大多数网站使用http,哪种方法最好?我不知道选项2,这似乎是一个非常好的方法.
我正在尝试将 iframe(包含shellinabox,如果相关)嵌入到 HTTPS 网页上。我用来嵌入 iframe 的 HTML 非常简单:
<div class="jumbotron" style="min-height: 400px;">
<iframe src="https://example.com/shellinabox" style="border:none; min-height: 400px;" width="100%"></iframe>
</div>
Run Code Online (Sandbox Code Playgroud)
但是,Chrome 阻止加载 iframe,因为它是“不安全的内容”,我必须手动取消阻止它才能工作。Chrome 控制台报错如下:
Mixed Content: The page at 'https://example.com/mainpage/' was loaded over HTTPS, but requested an insecure resource 'http://example.com/shellinabox/'. This request has been blocked; the content must be served over HTTPS.
Run Code Online (Sandbox Code Playgroud)
我对此感到困惑,因为显然我的 HTML 代码嵌入了example.com/shellinabox. 而且,当我https://example.com/shellinabox直接访问时,锁定图标是绿色的,没有被阻止,并且该页面上没有任何 SSL 问题的迹象。
我还在 Firefox、IE 和 MS edge 中对此进行了测试,它们都具有相同的行为(因此这不是 Chrome 特定的问题)。是什么赋予了?
我搜索了论坛,但我无法弄清楚如何修复我网站上的混合内容错误以使其成为https.
以下是chrome的错误:
混合内容:页面https://www.example.com/是通过HTTPS加载的,但请求了一个不安全的样式表http://fonts.googleapis.com/css?family=Oswald:300,400,700.此请求已被阻止; 内容必须通过HTTPS提供.
我是一个完整的菜鸟,不知道在哪里/什么改变.
请提供noob指示,提前谢谢,决议将允许我发布....非常感谢!
- -更新 - -
它不起作用(可能是因为我).这是在functions.php文件的代码中的位置,但它不起作用(我在https ssl函数上将http更改为https)
$open_sans = _x( 'on', 'Open Sans font: on or off', 'Divi' );
if ( 'off' !== $open_sans ) {
$font_families = array();
if ( 'off' !== $open_sans )
$font_families[] = 'Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800';
$protocol = is_ssl() ? 'https' : 'http';
$query_args = array(
'family' => implode( '%7C', $font_families ),
'subset' => 'latin,latin-ext',
);
$fonts_url = add_query_arg( $query_args, "$protocol://fonts.googleapis.com/css" );
}
return $fonts_url;
}
endif;
Run Code Online (Sandbox Code Playgroud) 我在我的网站中使用 gmaps 显示地图。
我的代码
<div class="col-md-12" >
<script type="text/javascript" content="zk.googleAPIkey='***MyKey***'" />
<gmaps id="gmaps" zoom="${initialZoom}" lat="${initialLatitude}" lng="${initialLongitude}" width="100%" height="350px" showSmallCtrl="false" >
<gmarker id="marker" content="" visible="${false}" />
</gmaps>
</div>
Run Code Online (Sandbox Code Playgroud)
在我的本地服务器中工作正常,但在我的生产服务器中https不起作用,并且出现此错误:
例外
zk.wpd:20 Mixed Content: The page at 'https://www.domain.com/' was loaded over HTTPS, but requested an insecure script 'http://www.google.com/jsapi?key=***MyKey***'. This request has been blocked; the content must be served over HTTPS.loadScript @ zk.wpd:20
Run Code Online (Sandbox Code Playgroud) 我目前有以下问题
Mixed Content: The page at 'https://www.example.com/' was loaded over HTTPS, but requested an insecure stylesheet
Run Code Online (Sandbox Code Playgroud)
这是httpd安装了Centos服务器上的Wordpress网站。
我在`http.conf中有以下虚拟主机设置:
NameVirtualHost *:80
NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot /var/www/html/example
ServerName www.example.com
ServerAlias example.com
SSLEngine on
SSLCACertificateFile /etc/httpd/conf/ssl.crt/intermediate.crt
SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
</VirtualHost>
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
Redirect / https://www.example.com/
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
在我这里,httpd.conf我改变AllowOverride了所有,所以看起来像这样:
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)
我可以确认htaccess正在使用iTheme安全插件,并且可以正常运行,如果在“我”中输入了一些垃圾,也会htacces收到服务器配置错误。
我已经更改了仪表板中的两个Wordpress URL来https代替http。 …
我有兴趣将我的整个网站从http切换到https.
我担心的是我有一些内容使用绝对的http URL.
我需要编辑每个页面,以便将这些URL更改为相对,但这可能需要一段时间才能完成.
我想知道的是,是否有办法通过Google跟踪代码管理器使用Javascript,以便将本地绝对URL重写为HTTPS而不是HTTP?
如果可以的话,它可以用作永久解决方案吗?
我们已经在Azure上部署了api,并试图在用angular 5编写的Web应用程序中使用该API。但是,当我们尝试使用该API时,会遇到以下错误。
Chrome混合内容:“ https://somedevapp.azurewebsites.net/#/managesomething ”上的页面已通过HTTPS加载,但请求了不安全的XMLHttpRequest端点' http://admindevapp.azurewebsites.net/api/data/getdata ' 。该请求已被阻止;内容必须通过HTTPS提供。
Firefox阻止加载混合的活动内容
这个问题与CORS有关吗?如何解决这个问题?
任何帮助对此表示赞赏!
我有一个在 Cloud Run(nginx 网络服务器)上运行的 Angular Web 应用程序(更多信息在这里),我想从中获取来自 GCP 元数据服务器的访问令牌。我试图调用https://metadata.google.internal(使用 Cloud Shell 中的 curl),但连接被拒绝。对 HTTP 的调用运行良好。
当我通过 HTTP 从我的应用程序(通过 https 加载)调用元数据服务器时 - 从逻辑上讲,我收到了一个混合内容错误。当尝试通过 HTTPS 访问元数据服务器时 - 我收到错误 504 网关超时,我假设是由于元数据服务器拒绝 HTTPS 调用的原因。
我将非常感谢有关如何解决此问题的任何想法。
metadata nginx google-cloud-platform mixed-content google-cloud-run
mixed-content ×10
https ×5
ssl ×3
html ×2
wordpress ×2
.htaccess ×1
angular5 ×1
apache ×1
azure ×1
cloudflare ×1
github-pages ×1
google-maps ×1
iframe ×1
javascript ×1
magento ×1
metadata ×1
nginx ×1
web-config ×1
windows ×1
zk ×1