0
我几乎尝试过任何可以在论坛和博客中找到的解决方案,但我没有运气,这就是为什么我现在要求任何帮助。nginx + nodejs + socket.io ERR_CONNECTION_TIMED_OUT
下面是这种情况,我目前使用的是Ubuntu,而且我在其中运行了2个套接字,之前运行完美,但是当我试图添加另外1个套接字时出现问题(ERR_CONNECTION_TIMED_OUT)。
这是我建立在NGINX我的第三座
upstream stream {
server localhost:3210;
}
server {
location /socket.io {
proxy_pass http://stream;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
这是完全相同的nginx的设置,我曾与我的第2个应用程序,这就是为什么我有一个艰难的时间来调试它也与nodejs服务器一起使用。
http.listen(3210, function(){
console.log('Listening on Port');
});
和前端
var socket = io.connect('http://testapp.com:3210');
是http://testapp.com正在80端口上运行。该死的,它让我很多时间都在调试这个端口。我只是困惑,因为我的其他两个应用程序运行相同的实现。非常感谢你@robertklep – Gerald