IAm*_*mes 5 nginx flask flask-sockets flask-socketio
我正在使用 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.
Run Code Online (Sandbox Code Playgroud)
小智 4
查看您的.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){...}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
14939 次 |
| 最近记录: |