How to set up your own private RTMP server using nginx

All Versions How to set up your own private RTMP server using nginx

Tomasz Góral

Active Member
The problem with nginx was solved by changing worker threads to 1. Any higher number and OBS disconnects at random times.

As for getting the stream to be SSL, I'm still working on that because some folks are afraid to go to a non secure site and the browser warns them as if they are entering a malware site.

And finally, I have a lag of a bout 40-50 seconds between activity on camera and when it appears in the web player. nginx has a huge playlist with over 20 fragment files. I wonder if that's why? I'd like to get this delay down to 5 seconds or so, but not sure how the fragment and other commands in nginx.conf work.
5 sec is not real, use LL-HLS but must change server because nginx-rtmp not working with LL-HLS (sub-second mode).
But if you want :
- keyframe set to 1 sec
- segment size set to 1 or 2 sec
- minimum segment list set to 3
now you got 6 second lags.


New Member
Hi, first of all, thanks for this wonderfull guide! now i have just a few questions...
i plan on streaming via my mobile phone on a 4G or 5G network which is sadly not so reliable as i whished. is there an option i can set up so if the Input stream stops, it starts sending a "currently disconnected, but please stand by" media file till the connection is back but doesnt disconnect the output to Twitch, FB, TikTok what ever... ?

i just say thanks in advance, even if there is no way currently.

Love Kim