How to set up your own private RTMP server using nginx

How to set up your own private RTMP server using nginx

Super easy to follow, got me out of a hole. Thanks so much.
Thank you very much for the excellent guide. I have used it for month withour any problems on a vps to simultanously stream to facebook and YouTube. Now facebook is changing to only accept SSL-connections via RTMPS on Port 443. If I edit nginx.conf by adding "push rtmps://" I cannot start the server. Can anybody help me????
This was great, it works like a charm!
For using this with SSL, I wrote instructions on how to use Nginx for Facebook
This indeed worked. One question: do I have to go through this every time I want to stream?
This got me set up easily way back!! It mad my stream quality amazing. I am having trouble now I have upgraded to windows 10. I cant seem to push to the server any more. I get a "Could not access the specified channel or stream key, please double check your stream key. If it is correct, there may be a problem contacting the server" error. I know my IP/Port are correct as if I try any other port through OBS I get an instant failure to connect. Using the ip and set port in my config file is the only connection attempt that returns that error. Any suggestions? I'm pulling my hair out.
I have the same issue as
"BreakTV 5.00 star(s) Jan 25, 2018
When i start the nginx via cmd nothing hapends and when i type my ip adress in my broswer to test the server the page doesn't load...."

Now when i run nginx without adding rtmp code at the bottom of the conf file, nginx runs and can be found on web browser - localhost.

Only after i edit the conf file and add the rtmp code, nginx does not run anymore and server cannot be found as localhost in web browser.
what am i doing wrong pls?

I couldn't get this to work because I was using a network bridge, but my friend who wasn't got his to work fine. I guess just keep that inmind if you're doing this.
Great guide but for some reason I'm running into the same issue as another. When I stream my CPU usage goes just as high as when I'm streaming normally to twitch.
This worked well for me, but the document can be updated in one respect: It is not necessary to compile Nginx, because libnginx-mod-rtmp can be installed from the repositories (at least with Ubuntu). So nginx and the mod can be installed with apt.
Also another problem might occur: One of our favorite live platforms ;) Facebook does only accept RTMPS connections which Nginx does not support. This problem can be solved using Stunnel, here is a good documentation:
I set this up on my Odroid HC2. Because I have OMV running and access it with port 80, I had to change the default listen port from port 80 to something else. I can still use my Odroid's internet IP address in the rtmp link in OBS to successfully stream. So, like, rtmp:// I have a dynamic dns setup to access the Odroid HC2 server, but when I go use rtmp:// in OBS, it does not work. What do I need to do (port forwarding, whatever) to stream remotely?
I think this guide is outdated.
It mentions version 1.15.1 at the top, then asks us do download a file, and then extracting a file, that we haven't been intructed to download. And after that it wants us to go to a folder named nginx-1.13.1, which doesn't exist, because we downloaded the 1.15.1.

If I extract the 1.15.1 file and the, the installation in the next steps fails.
same if I download the 1.13.1 file and, although I get a different error.

I'm using ubuntu in windows.
Hi Popupkiller,

I missed a couple spots when I recently updated the guide for a newer version, thanks. The correct files are nginx-1.15.1.tar.gz for nginx and for the rtmp module.
Thanks for writing this, it got me fairly far. However it does assume a bit of prior knowledge. I've used Linux before, but not extensively.
I found out that I needed to install unzip. I had to Google that. For newbies, it would be good to include this line before unzipping:
sudo apt-get install zip unzip

Also for the initial line:
sudo apt-get install build-essential libpcre3 libpcre3-dev libssl-dev
I got loads of 404 errors. That's apparently because some of the paths are old. I Googled and found that the following worked:

apt-get update && install build-essential libpcre3 libpcre3-dev libssl-dev

Not sure why!

However, when I got to the end and added to the config file and tried to stream to it from OBS I just got server not found.

I used something similar to this:
rtmp {
listen 1935;
chunk_size 4096;

application live {
live on;
record off;
push rtmp://[streamkeyfromtwitch];
push rtmp://[streamkeyfromyoutube];

and streamed to rtmp://(My-IP)/live

Any thoughts on how I can debug this. I really don't like it when things don't work!
It's working but only kinda stream labs cant connect to the server but when I go in and type the server up into google it comes up just like it should and I have no clue how to fix it
I am incredibly thankful for this guide!! There are a few things missing for newer users though. I had never used Ubuntu before so I had to learn a lot to get this to work.

1.) When I first installed NGINX, I didn't have a user created (didn't know I needed one) which caused problems because the installs default location is inside a user folder.

2.) When he says to "edit the config file" I had absolutely no clue how to even begin doing that from a command line. But I learned that I needed to use the "vi" editor, and was able to find some other tutorials online about it.

Again, incredibly thankful for this guide, but it seems aimed at users who are already familiar with Ubuntu. But there are many novice users who could use this functionality who would benefit from a more comprehensive tutorial.
This was really simple to set up. Although, having issues with timing and keyframe intervals. Twitch and Youtube keep complaining odd timing.
Is there a way to configure RTMPS over port 443 with NGINX?
This is required for streaming to Facebook.

You have done something wrong when it comes to installing the RTMP modules, if anyone is getting an error when configuring the RTMP config file do this >> ./configure --with-http_ssl_module --add-module=../nginx-rtmp-module-dev << As you can see, I changed the 'module' at the end to 'dev' as you are no longer downloading but Hope this helps some people!
Looks like that was one more spot I missed when I did the update a couple weeks ago, thanks for the catch. Sorry about that.