strongloop / strong-pm

deployer for node applications
http://strong-pm.io
Other
1k stars 71 forks source link

socket.io deploy under strong-pm with nginx proxy server problems #328

Closed masalinas closed 4 years ago

masalinas commented 8 years ago

I'm testing the strongloop chat test app: loopback-example-socket.io-chat. I deployed under strong-pm (5.0.1) with two workers like this:

Service ID: 1 Service Name: loopbackchat Environment variables: No environment variables defined Instances: Version Agent version Debugger version Cluster size Driver metadata 5.0.1 2.0.2 1.0.0 2 N/A Processes: ID PID WID Listening Ports Tracking objects? CPU profiling? Tracing? Debugging? 1.1.22486 22486 0 1.1.22491 22491 1 0.0.0.0:3001 1.1.22547 22547 2 0.0.0.0:3001

Installed nginx proxy server (1.8.1) and configure like this: upstream chat { ip_hash; server 127.0.0.1:3001; }

server { listen 80; server_name chat.com;

location /socket.io/ { proxy_pass http://chat/socket.io;

# enables WS support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

}

location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true;

proxy_pass http://chat;

} }

But when browse to http://chat.com I obtain this continously:

GET http://chat.com/socket.io/?EIO=3&transport=polling&t=1458488446314-1 404 (Not Found)

How can I integrate socket.io+nginx+strong-pm correctly??

Also if browse many times to: 127.0.0.1:3001 the browcast messages are not send to all terminals ... What is wrong? or what more I must to installe or configure??

Regards.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding.