Now, I had patched nginx with the nginx_tcp_proxy_module
, and it is running OK on port 8080.
How do I connect the clients to port 80 of nignx, not port 8080 of Node.js, so that having the nginx forward the request to Node.js?
Now, I had patched nginx with the nginx_tcp_proxy_module
, and it is running OK on port 8080.
How do I connect the clients to port 80 of nignx, not port 8080 of Node.js, so that having the nginx forward the request to Node.js?
Just change 8080 to 80. But TCP and HTTP on the same port is not possible.
Host: your.nodejs.socketio.com
to 127.0.0.1:8080 If you go down this route you will probably want to preserve client IPs:
Use X-Forwarded-For in socket.io
socketio.handshakeData = function(data) {
var d = socketio.Manager.prototype.handshakeData(data);
d.ip = data.request.headers['x-forwarded-for'] || data.request.connection.remoteAddress;
return d;
};