简体   繁体   English

Nginx letsencrypt nodejs:此页面正尝试从未经身份验证的页面加载脚本

[英]Nginx letsencrypt nodejs : this page is trying to load scripts from unauthenticated

I'm new to ssl setup and I was fallowing a tutorial on how to setup a node.js application with nginx and a ssl certification 我是ssl设置的新手,正在休会有关如何使用nginx和ssl证书设置node.js应用程序的教程

"The tutorial": https://code.lengstorf.com/deploy-nodejs-ssl-digitalocean/?utm_source=nodeweekly&utm_medium=email “本教程”: https : //code.lengstorf.com/deploy-nodejs-ssl-digitalocean/?utm_source=nodeweekly&utm_medium=email

Everything went well and I'm able to access the site via https but in Chrome at the right sidebar I can see this warning (This page is trying to load scripts from unauthenticated sources) 一切顺利,我可以通过https访问该网站,但是在右侧边栏中的Chrome中,我可以看到此警告(此页面正尝试从未经身份验证的来源加载脚本)

any idea of what may be? 有什么可能的想法吗?

This means that you have some HTTP links in <script> tags in your HTML. 这意味着您在HTML的<script>标记中有一些HTTP链接。

You need all your links in HTML to be HTTPS (scripts, images, styles etc.) 您需要将HTML中的所有链接都设为HTTPS(脚本,图像,样式等)。

Those could be links to libraries like jQuery, some analytics scripts or even your own scripts on your own page that get loaded with <script src="http://..."> 这些链接可能是指向jQuery之类的库的链接,一些分析脚本,甚至是您自己页面上的脚本,这些<script src="http://...">加载<script src="http://...">

For example, if you have something like this in HTML: 例如,如果您在HTML中具有以下内容:

<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.js">
</script>

Change it to: 更改为:

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.js">
</script>

This is also possible, but less likely, that you have some scripts that are requested over HTTPS but the requests get redirected to HTTP. 您也可以通过HTTPS请求某些脚本,但是将请求重定向到HTTP,但这不太可能。 Open the browser's developer console and see which requests for which files are causing those warnings and find out where they are referenced in the HTML that the browser is getting. 打开浏览器的开发人员控制台,查看哪些文件引起了哪些警告,这些警告并找出浏览器在HTML中引用它们的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM