我正在使用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.

解决方法:

查看.js文件,确保使用正确的ajax URL(//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){...}
});


标签: nginx, flask, flask-socketio, flask-sockets

相关文章推荐

添加新评论,含*的栏目为必填