我正在使用Nginx + flask-socketio + aws elb,当在https上加载URL时,我收到以下错误消息,这是与Nginx和套接字相关的内容,请帮助解决此问题,
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.
答案 0 :(得分:2)
查看您的.js
文件,确保使用正确的ajax网址(//your_site.com/handler
,而不是http://your_site.com/handler
),例如:
$.ajax({
url:'//your_site.com/handler',dataType:'json',type:'get',
success: function(data){...},
complete:function(xhr, textStatus){...}
});
答案 1 :(得分:1)