- Backend: callbacks on_publish/on_publish_done, UpdateStreamURL, GetByStreamKey - Nginx-RTMP: config infra, docker-compose service (profil live) - Frontend: stream_url dans LiveStream, HLS.js dans LiveViewPlayer, état Stream terminé - Chat: rate limit send_live_message 1 msg/3s pour rooms live_streams - Env: RTMP_CALLBACK_SECRET, STREAM_HLS_BASE_URL, NGINX_RTMP_HOST - Roadmap v0.10.6 marquée DONE
57 lines
1.5 KiB
Nginx Configuration File
57 lines
1.5 KiB
Nginx Configuration File
# v0.10.6 F471: Nginx-RTMP for live stream ingest
|
|
# OBS connects to rtmp://host:1935/live with stream key = stream_key from API
|
|
|
|
worker_processes 1;
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
rtmp {
|
|
server {
|
|
listen 1935;
|
|
chunk_size 4096;
|
|
|
|
application live {
|
|
live on;
|
|
# HLS output for playback (2s segments)
|
|
hls on;
|
|
hls_path /tmp/hls;
|
|
hls_fragment 2s;
|
|
hls_playlist_length 6s;
|
|
hls_cleanup on;
|
|
hls_nested on;
|
|
|
|
# Callbacks to backend for stream_key validation and is_live updates
|
|
# Params: name=stream_key, addr, app, etc.
|
|
on_publish http://backend-api:8080/api/v1/live/callback/publish;
|
|
on_publish_done http://backend-api:8080/api/v1/live/callback/publish_done;
|
|
}
|
|
}
|
|
}
|
|
|
|
# HTTP server for HLS playback and stat
|
|
http {
|
|
server {
|
|
listen 8080;
|
|
server_name localhost;
|
|
|
|
# HLS playlists and segments: /live/{stream_key}/playlist.m3u8 -> /tmp/hls/{stream_key}/
|
|
location /live/ {
|
|
types {
|
|
application/vnd.apple.mpegurl m3u8;
|
|
video/mp2t ts;
|
|
}
|
|
alias /tmp/hls/;
|
|
add_header Cache-Control no-cache;
|
|
add_header Access-Control-Allow-Origin *;
|
|
}
|
|
|
|
location /stat {
|
|
rtmp_stat all;
|
|
rtmp_stat_stylesheet stat.xsl;
|
|
}
|
|
location /stat.xsl {
|
|
root /etc/nginx;
|
|
}
|
|
}
|
|
}
|