nginx-rtmp-module
nginx-rtmp-module copied to clipboard
rtmp error
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
Can you share the nginx.conf
http://pastebin.com/f3GBGUs7
It's better to check your error log file!
where are the error log files?
/usr/local/nginx/logs/error.log
I tried with your configuration, and I got the same error in the nginx.conf
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
The push is right, i habe Seen many Videos wäre this worked
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.
look here https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rtmp-server-using-nginx.50/ there is the directive push.
i have testet it with nno push but the same error came
application live1 {â
this is a typo right?
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.
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
yea why not, but same apply for sites available
include /usr/local/nginx/conf.d/.conf; include /usr/local/nginx/sites-enabled/;