【发布时间】:2021-08-29 22:34:48
【问题描述】:
我正在尝试使用tiangolo/nginx-rtmp 设置 RTMP 服务器,但是当我尝试运行 docker-compose up 时似乎出现以下错误:
Attaching to rtmp_server
rtmp_server | 2021/08/29 22:25:57 [emerg] 1#1: directive "events" has no opening "{" in /etc/nginx/nginx.conf:5
rtmp_server | nginx: [emerg] directive "events" has no opening "{" in /etc/nginx/nginx.conf:5
rtmp_server exited with code 1
理论上它应该在 nginx.conf 的第 5 行缺少 {,但我的 nginx.conf 看起来像这样:
worker_processes auto;
rtmp_auto_push on;
events{} # Tried events { }, events{ } but none seem to work
rtmp {
server {
listen 1935;
listen [::]:1935 ipv6only=on;
application live {
live on;
record off;
}
}
}
运行 nginx -t 返回:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
【问题讨论】:
-
你试过使用官方的 nginx docker 镜像吗? hub.docker.com/_/nginx
-
由于某种原因 docker-compose build 没有通过并且没有给我任何错误,因此它正在更新我的更改。重启后一切正常。
-
很高兴听到 :) 请将其作为答案发布并接受或关闭问题
-
已经关门了吗?说不出来
标签: docker nginx docker-compose rtmp