Luis Montoya
Luis Montoya

Reputation: 3207

Nginx setup for Node Media Server

I'm trying to run node-media-server on a EC2 instance, but i a'm not able to make OBS to connect to the server, here is my Nginx config:

server {
    listen 8000;
    listen 1935;
    server_name example.com;

    location / {
        proxy_pass http://localhost:$server_port;
        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;
    }
}

And here is my security group set up: enter image description here

Any idea what is going on?

Thanks in advance,

Upvotes: 0

Views: 785

Answers (1)

Luis Montoya
Luis Montoya

Reputation: 3207

I found the problem, the first thing is to setup Nginx to listen on the port 80 only as node-media-server takes care of listening on the ports 8000 and 1935

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://localhost:$server_port;
        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;
    }
}

Second thing is to make sure the ports 8000 and 1935 are open in the server as by default they are not.

Hope it helps to anyone with the same problem.

Upvotes: 0

Related Questions