January 12, 2014 12:45PM
I have a node application that uses websockets. I'm using a custom config file like this. However, when I post to the application, the post isn't appearing in the client side of the application. Since it's using websockets to communicate between client and server, i'm wondering if I have a problem with the port numbers. You can see in my config that the server is listening on 80, but the proxy_pass is set to localhost:3000. Should these numbers be the same? if so can I set Nginx to listen on 3000?

/etc/nginx/conf.d/domainame.com.conf

server {
listen 80;

server_name your-domain.com;

location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
Subject Author Posted

nginx port for socket.io

mrblah January 12, 2014 12:45PM

Re: nginx port for socket.io

Andy Tynefield January 12, 2014 11:06PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 248
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready