Mixed Content: The https page was loaded via https but requested insecure

I am using Nginx + flask-socketio + aws elb, and when the url loads on https, I get the following error message that is related to Nginx and socket, please help with this.

socket.io.min.js:2 Mixed Content: The page at 'https://localhost/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://localhost/socket.io/1/?t=1477375737508'. This request has been blocked; the content must be served over HTTPS.d.handshake @ socket.io.min.js:2
socket.io.min.js:2 XMLHttpRequest cannot load http://localhost/socket.io/1/?t=1477375737508. Failed to start loading.
+4
source share
2 answers

Take a look at your .jsfile, make sure you use the correct ajax url ( //your_site.com/handlerinstead http://your_site.com/handler), for example:

$.ajax({
url:'//your_site.com/handler',dataType:'json',type:'get',
success: function(data){...},
complete:function(xhr, textStatus){...}
});
+2
source

- , , - , "" HTTPS, . , HTTPS, HTTPS TLS .

URI Websockets TLS wss - ws. Chromium Firefox https + ws , wss URI secure/HTTPS ws.

+1

Source: https://habr.com/ru/post/1658767/


All Articles