Search code examples
node.jsnginxrtmp

rtmp nodejs server config on NGINX _ nginx: [emerg] bind() to 0.0.0.0:1935 failed (98: Address already in use)


I have media server running on port 1935 .

and I have a subdomain: "streaming.foo.com"

I need to configure Nginx to access rtmp://streaming.foo.com

I tried the RTMP Nginx plugin with this blog :

https://www.nginx.com/blog/video-streaming-for-remote-learning-with-nginx/

and configured the /etc/nginx/nginx.conf file.

rtmp {
    server {
        listen 1935;
        application live {
            live on;
            dash on;
            dash_path /tmp/dash; // what is this config??
            dash_fragment 15s;
        }
    }
}

but I get this error from nginx :

nginx[176987]: nginx: [emerg] bind() to 0.0.0.0:1935 failed (98: Address already in use)


Solution

  • It is RTMP, not HTTP. Nginx is a web server, which can proxy and balance HTTP only. It is not a general proxy server.

    Use a general Proxy or Load balancer, like HA Proxy.