【问题标题】:directive "events" has no opening "{" in /etc/nginx/nginx.conf指令“事件”在 /etc/nginx/nginx.conf 中没有开头的“{”
【发布时间】: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


【解决方案1】:

由于某种原因 docker-compose build 没有通过并且没有给我任何错误,因此它正在更新我的更改。重启后就正常了。

【讨论】:

    猜你喜欢
    • 2020-03-30
    • 2021-10-27
    • 2021-08-30
    • 2020-02-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-21
    相关资源
    最近更新 更多