Open firewire10000 opened 4 years ago
rtmp
block must be put in root context.
If you put the configuration inside sites-enabled, it is included in http {}
context, which will not work.
see https://github.com/arut/nginx-rtmp-module/wiki/Directives#rtmp
rtmp
block must be put in root context. If you put the configuration inside sites-enabled, it is included inhttp {}
context, which will not work.see https://github.com/arut/nginx-rtmp-module/wiki/Directives#rtmp
Can the sites-enabled be excluded from the HTTP block and still be picked by the nginx.conf still, or will it not work that way?
Inside the /etc/nginx/nginx.conf could I place the following?
rtmp {
include /etc/nginx/sites-enabled/*
}
Please do not do this kind of mixing files, they are different kind, it will make things complicated and error prone.
http {
include sites-enabled/*.conf;
}
rtmp {
include rtmp-enabled/*.conf;
}
anyway, if you still want to put them in same folder, you can use different file name pattern(for example different file name extension).
http {
include sites-enabled/*.conf;
}
rtmp {
include sites-enabled/*.rtmp;
}
Sadly appending an extension to the file that holds my RTMP block and then modifying the nginx.conf file still doesn't work.
nginx: [emerg] "rtmp" directive is not allowed here in /etc/nginx/sites-enabled/livestream.rtmp:3
@firewire10000 You are redefining rtmp
directive inside rtmp
, that's why the error happen.
If your /etc/nginx/sites-enabled/*.rtmp
files contains the following:
rtmp {
server {
listen 1935;
application live {
live on;
}
}
}
You should remove the rtmp
directive:
server {
listen 1935;
application live {
live on;
}
}
My RTMP block works perfectly inside the /etc/nginx/nginx.conf but as soon as I add it into a file under /etc/nginx/sites-enabled directory I get error messages. My simple question can RTMP blocks be read from the sites-enabled directory? If so how do I get it to work please?