Heroku错误:页面已通过HTTPS加载,但请求了不安全的脚本"angular-route.js" [英] Heroku error: page was loaded over HTTPS, but requested an insecure script 'angular-route.js'
问题描述
我已经将我的nodejs
应用程序部署到了heroku
.
我在index.html
下有此文件,但是以某种方式heroku
将此错误消息抛出我到chrome开发者控制台(F12).
I've deployed my nodejs
app to heroku
.
I have this file below as my index.html
but somehow heroku
is throwing me this error message to the chrome developer console (F12).
错误:
混合内容:" https://small-talkz.herokuapp.com/上的页面' 曾是 通过HTTPS加载,但请求了不安全的脚本 ' http://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular-route.js ". 该请求已被阻止;内容必须通过HTTPS提供.
Mixed Content: The page at 'https://small-talkz.herokuapp.com/' was loaded over HTTPS, but requested an insecure script 'http://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular-route.js'. This request has been blocked; the content must be served over HTTPS.
index.html:
index.html:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
$http.get('https://code.angularjs.org/1.4.9/angular.js').success(successCallback);
</script>
<script data-require="angular.js@1.4.x" src="https://code.angularjs.org/1.4.9/angular.js" data-semver="1.4.9">
</script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular-route.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.3.1/angular-ui-router.min.js"></script>
<script src="/socket.io/socket.io.js"></script>
<script src="script.js"></script>
<link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<div ng-app="mymodule" ng-view>
</div>
</html>
推荐答案
请注意,托管angular-route
的CDN中没有HTTPS-表示它未以安全协议提供.
Notice your CDN that's hosting angular-route
does not have HTTPS in it - means it is not served in secure protocol.
要么在Heroku(自然是HTTPS)上托管它的副本,要么找到要使用的新CDN.
Either host a copy of it on Heroku (naturally - HTTPS) or find a new CDN to work with.
如上所述,您可以将http://
替换为https://
,因为Google的API可以通过https提供.
as mentioned you can just replace http://
with https://
since Google's APIs can be served through https.
这篇关于Heroku错误:页面已通过HTTPS加载,但请求了不安全的脚本"angular-route.js"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!