diegoddox diegoddox - 10 months ago 77
Node.js Question

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

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?

rsp rsp
Answer Source

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">

Change it to:

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

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.