This error appears only when i connect from android application using mobile internet, but via wifi all works.
nginx error.log:
connect() failed (111: Connection refused) while connecting to upstream, client: 79.143.100.252, server: 0.0.0.0, request: "GET /socket.io/?EIO=3&transport=websocket HTTP, upstream: "http://127.0.0.1:8001/socket.io/?EIO=3&transport=websocket", host: "XX:XX:XX:XX"
nginx access.log:
"GET /socket.io/?EIO=3&transport=websocket HTTP/1.1" 101 104 "-" "okhttp/3.5.0"
In websocket app i see always accepted connecting (infinity reconnection) but no events were called.
My nginx conf:
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
server {
listen 80;
server_name 0.0.0.0;
location / {
proxy_pass http://127.0.0.1:8000;
}
location /socket.io {
proxy_send_timeout 150;
include proxy_params;
proxy_http_version 1.1;
proxy_buffering off;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_pass http://127.0.0.1:8001/socket.io;
}
}
UPDATE:
It was Android issue - we needed to delete all additional settings for okhttp