47 lines
1.1 KiB
Nginx Configuration File
47 lines
1.1 KiB
Nginx Configuration File
worker_processes 1;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
rtmp {
|
|
|
|
server {
|
|
listen 1935; # RTMP listen port
|
|
|
|
application live {
|
|
live on;
|
|
|
|
# HLS Configuration (optional)
|
|
hls on; # Enable HLS conversion
|
|
hls_path /tmp/hls; # Path to store HLS files (use an absolute path)
|
|
hls_nested on;
|
|
hls_fragment 5s; # Duration of each HLS segment
|
|
hls_playlist_length 15s; # Length of HLS playlist (total duration)
|
|
}
|
|
}
|
|
}
|
|
|
|
http {
|
|
# Enable HLS
|
|
server {
|
|
listen 8080;
|
|
|
|
location /hls/ {
|
|
types {
|
|
application/vnd.apple.mpegurl m3u8;
|
|
video/mp2t ts;
|
|
}
|
|
add_header Access-Control-Allow-Origin *;
|
|
|
|
root /tmp/;
|
|
autoindex on;
|
|
}
|
|
|
|
location /api/ {
|
|
rewrite ^/api/(.*)$ /$1 break;
|
|
proxy_pass http://web_server:5000; # flask-app is the name of the Flask container in docker-compose
|
|
}
|
|
}
|
|
}
|