简体   繁体   中英

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

"The tutorial": 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)

any idea of what may be?

This means that you have some HTTP links in <script> tags in your HTML.

You need all your links in HTML to be HTTPS (scripts, images, styles etc.)

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://...">

For example, if you have something like this in 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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