nginx-rtmp-module icon indicating copy to clipboard operation
nginx-rtmp-module copied to clipboard

rtmp error

Open leytilera opened this issue 8 years ago • 16 comments

when i add the rtmp config to the file there ist this error message: nginx: [emerg] "rtmp" directive is not allowed here in /usr/local/nginx/conf/nginx.conf:118

leytilera avatar Dec 13 '16 16:12 leytilera

Can you share the nginx.conf

somosmultimedia avatar Dec 13 '16 17:12 somosmultimedia

http://pastebin.com/f3GBGUs7

leytilera avatar Dec 13 '16 17:12 leytilera

It's better to check your error log file!

coditori avatar Dec 14 '16 16:12 coditori

where are the error log files?

leytilera avatar Dec 14 '16 18:12 leytilera

/usr/local/nginx/logs/error.log

somosmultimedia avatar Dec 14 '16 19:12 somosmultimedia

I tried with your configuration, and I got the same error in the nginx.conf

somosmultimedia avatar Dec 14 '16 19:12 somosmultimedia

I found the directive for push is incorrect. take a look at https://github.com/arut/nginx-rtmp-module/wiki/Directives#exec here is your solution

somosmultimedia avatar Dec 14 '16 19:12 somosmultimedia

The push is right, i habe Seen many Videos wäre this worked

leytilera avatar Dec 14 '16 21:12 leytilera

what I'm saying is that I test with your configuration in my own installation and I got the same error. And I also saw the push configuration different from the manual.

somosmultimedia avatar Dec 14 '16 22:12 somosmultimedia

look here https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmp-server-using-nginx.50/ there is the directive push.

leytilera avatar Dec 15 '16 19:12 leytilera

i have testet it with nno push but the same error came

leytilera avatar Dec 16 '16 16:12 leytilera

application live1 {â

this is a typo right?

campones avatar Dec 22 '16 00:12 campones

Had this issue after following the guide here: https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmp-server-using-nginx.50/

Solved my own issue after moving the RTMP configuration sample BELOW the last bracket.

I blame old HTML habits, the guide states: "add the following at the very end of the file", so be sure to do that.

xwizzard avatar Sep 13 '18 21:09 xwizzard

A more modular way to do this in order to leave the package-installed configuration file minimally unaltered is to put the RTMP configuration in a separate file and use nginx include directive to pull it in.

I hit this report due to putting a separate RTMP configuration file in /etc/nginx/conf.d/ and seeing:

nginx: [emerg] "rtmp" directive is not allowed here in /etc/nginx/conf.d/obs-stream-proxy.conf:1

It turns out conf.d/ is ONLY for the http service since there is a include directive for http inside its block in the main nginx.conf (at least on Debian/Ubuntu).

I create a separate directory for RTMP configuration files and include all *.conf files from there. One line needs adding to the end of the existing nginx.conf outside of any blocks:

# echo "include /etc/nginx/rtmp.conf.d/*.conf;" >> /etc/nginx/nginx.conf

Then we create the directory and place our RTMP configuration file(s) there:

# mkdir /etc/nginx/rtmp.conf.d

# cat <<EOF >/etc/nginx/rtmp.conf.d/live.conf
rtmp {
 server {
    listen 1935;
    application live {
      allow publish all;
      allow play all;
      live on;
      meta copy;
      push "rtmp://example.com/live/key";
    }
  }
}
EOF

# systemctl start nginx
# systemctl status nginx

iam-TJ avatar Sep 12 '22 17:09 iam-TJ

yea why not, but same apply for sites available

include /usr/local/nginx/conf.d/.conf; include /usr/local/nginx/sites-enabled/;

campones avatar Sep 12 '22 17:09 campones