Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hello! I have a website that is hosted in Digital Ocean
Let’s call it https://example.com
This site has let’s encrypt for SSL certification and it is working fine it has NODE JS as the back end.
Recently I made a new NODE JS application that uses socket.io with REACT JS and runs on port 6000.
I intend to run the new app (a separate node app that runs the whole website) by using https://example.com/me/chat
so I used the below on the default config file
location /me/chat/ { proxy_pass http://localhost:6000/; }
location /me/chat {
proxy_pass http://localhost:6000/;
}
That looks fine up to here and the web page could be loaded.
Now the problem is socket io
inside my main app in node js
const io = require("socket.io")(httpServer, {
path: "/me/chat/socket.io/", // I used without path too
cors: {
origin:
// regarding to origin cors
},
"sync disconnect on unload": true,
});
Inside react JS forsocket.io-client :
const socket = io(HTTP://www.example.com/me/chat, {
path: "/me/chat/socket.io/", // I used without path too
});
and finally, I added the following inside the Nginx default config
location /me/chat/socket.io/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://localhost:6000/; # I tested this line with http://localhost:6000/socket.io/ or http://localhost:6000/me/chat/socket.io/ too and still does not work
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
The problem is that the socket io in the server never calls when react JS calls it. On the local machine, it is working fine and the problem only happens when I move it to digital ocean and want to do Nginx settings.
Thanks for any input!
009fd274aeae48f2bfbda6ef568676
Cloudstream Apk
032f50ee7f7d489db3b05e204fe139
032f50ee7f7d489db3b05e204fe139
Edward Sitarski
ebeecroft
dashan
34bcef38725b4e6eb5224ae028f17e
markatango
gouskova