当在sites-available (符号链接到sites-enabled)的文件中使用RTMP服务器块时,我很难让NGINX启动RTMP模块。NGINX配置文件都位于/etc/nginx/。
如果我在nginx.conf中直接使用下面的RTMP服务器块,服务器就会非常好地启动。但是,一旦我从include /etc/nginx/sites-enabled/*;行中删除nginx.conf中的注释,systemctl status nginx.service就会返回"nginx: [emerg] "rtmp" directive is not allowed here in /etc/nginx/sites-enabled/livestream:1
rtmp {
server {
listen 1935;
chunk_size;
application obs_output {
live on:
record off;
}
}
}这是我安装NGINX和RTMP模块时遵循的两个指南。
请问这是怎么回事?
事先非常感谢
发布于 2020-03-31 22:52:30
我不相信您可以从rtmp {}目录中声明一个/etc/nginx/sites-enabled块。
默认情况下,/etc/nginx/sites-enabled目录包含在现有的http {}块中。您可以通过查看/etc/nginx/nginx.conf来检查这一点。您不能在rtmp块中使用http块,它们需要彼此分离,因为它们是在同一级别上声明的。
唯一适合您的配置的nginx include将来自/etc/nginx/modules-enabled目录中。
https://unix.stackexchange.com/questions/576979
复制相似问题