nginx – 混合内容:https页面加载了https但请求不安全
作者:互联网
我正在使用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 来源: https://codeday.me/bug/20190627/1309478.html