简体   繁体   中英

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: 在此处输入图像描述

Any idea what is going on?

Thanks in advance,

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM