![NGINX RTMP는 사이트 지원 디렉터리 세트에서 작동하지 않습니다.](https://linux55.com/image/170167/NGINX%20RTMP%EB%8A%94%20%EC%82%AC%EC%9D%B4%ED%8A%B8%20%EC%A7%80%EC%9B%90%20%EB%94%94%EB%A0%89%ED%84%B0%EB%A6%AC%20%EC%84%B8%ED%8A%B8%EC%97%90%EC%84%9C%20%EC%9E%91%EB%8F%99%ED%95%98%EC%A7%80%20%EC%95%8A%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
sites-available
RTMP 서버 블록이 파일(링크된 기호) 내에서 사용될 때 RTMP 모듈로 NGINX를 시작하는 데 문제가 있습니다 sites-enabled
. NGINX 구성 파일은 모두 /etc/nginx/
.
서버 블록에서 다음 RTMP 서버 블록을 직접 사용하면 nginx.conf
서버가 정상적으로 시작됩니다. 그러나 줄 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 모듈을 설치할 때 따랐던 두 가지 가이드입니다.
https://helpdeskgeek.com/linux-tips/create-your-own-live-video-streaming-server-with-linux/
https://www.scaleway.com/en/docs/setup-rtmp-streaming-server/
어떤 아이디어가 있나요?
미리 감사드립니다
답변1
rtmp {}
디렉토리 에서 /etc/nginx/sites-enabled
블록을 선언 할 수 없다고 생각합니다 .
기본적으로 /etc/nginx/sites-enabled
디렉터리는 기존 블록 내에 포함됩니다 http {}
. 를 보면 이를 확인할 수 있습니다 /etc/nginx/nginx.conf
. 블록 rtmp
내에 블록을 가질 수 없으며 http
동일한 수준에서 선언되므로 서로 분리되어야 합니다.
nginx
include
구성에 적합한 유일한 것은 /etc/nginx/modules-enabled
디렉터리에 있는 것입니다.