worker_processes auto;

rtmp_auto_push on;

events {
    worker_connections 1024;
}

rtmp {
    server {
        listen 1935;
        listen [::]:1935 ipv6only=on;

        # Default application (e.g., for generic streams)
        application live {
            live on;
            record off;
        }

        # MiroTalk-specific endpoint
        application mirotalk {
            live on;
            record off;
        }
    }
}

http {
    server {
        listen 8081;

        location /stat {
            rtmp_stat all;
            rtmp_stat_stylesheet stat.xsl;
        }

        location /stat.xsl {
            root /usr/share/nginx/html;
        }
    }
}