我以前从未使用过Linux或Raspberry Pi,但为了创建自己的RTMP服务器,我买了一个。我用NGINX做了一个,并让它工作起来。现在,我正在尝试整合NOALBS以获得更多功能。我将我的工作.conf重命名为nginx-old.conf并复制到NOALBS .conf中,现在NGINX失败并显示此错误。
nginx: [emerg] unknown directive "rtmp_stat" in /etc/nginx/nginx.conf:26
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx.service: Control process exited, code=exited, status=1/FAILURE
nginx.service: Failed with result 'exit-code'.我的.conf如下:
worker_processes 1;
events {
worker_connections 1024;
}
http {
sendfile off;
tcp_nopush on;
directio 512;
include mime.types;
default_type application/octet-stream;
ignore_invalid_headers on;
log_format compression '';
server {
listen 80;
server_name localhost;
# This URL provides RTMP statistics in XML
location /stat {
if ($request_method = "GET") {
add_header "Access-Control-Allow-Origin" *;
}
rtmp_stat all;
# Use this stylesheet to view XML as web page
# in browser
rtmp_stat_stylesheet /stat.xsl;
}
location /stat.xsl {
# XML stylesheet to view RTMP stats.
# Copy stat.xsl wherever you want
# and put the full directory path here
# root /path/to/stat.xsl/;
root /var/www/html/stat.xsl;
}
location /control {
rtmp_control all;
}
}
}
rtmp {
log_format compression '';
server {
listen 1935;
ping 30s;
notify_method get;
chunk_size 8192;
ack_window 8192;
sync 4ms;
interleave on;
access_log logs/rtmp-access.log compression;
# Stream to "rtmp://IPHERE/publish/live".
application publish {
live on;
wait_video on;
wait_key on;
exec_options on;
publish_notify on;
play_restart on;
drop_idle_publisher 4s;
idle_streams off;
sync 4ms;
interleave on;
}
}
}我所编辑的唯一内容实际上是添加stat.xsl路径和Pi的IP地址(我在这里删除了它们)。有人能帮我吗?
发布于 2021-07-17 04:42:57
添加此标题:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;https://stackoverflow.com/questions/67346083
复制相似问题