mirror of
https://github.com/SrIzan10/hctv.git
synced 2026-06-06 00:56:56 +00:00
81 lines
1.5 KiB
Nginx Configuration File
81 lines
1.5 KiB
Nginx Configuration File
events {
|
|
worker_connections 1024; # Define the maximum number of simultaneous connections
|
|
}
|
|
|
|
rtmp {
|
|
server {
|
|
listen 1935;
|
|
|
|
application live {
|
|
live on;
|
|
record off;
|
|
|
|
on_publish http://localhost:3000/api/rtmp/publish;
|
|
}
|
|
|
|
application channel-live {
|
|
live on;
|
|
record off;
|
|
|
|
allow publish 127.0.0.1;
|
|
deny publish all;
|
|
|
|
hls on;
|
|
hls_path /dev/shm/hls;
|
|
hls_fragment 3;
|
|
hls_playlist_length 5;
|
|
hls_cleanup on;
|
|
|
|
hls_variant _low BANDWIDTH=500000;
|
|
hls_variant _mid BANDWIDTH=1000000;
|
|
hls_variant _hi BANDWIDTH=1500000;
|
|
}
|
|
}
|
|
}
|
|
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
# performance optimizations
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
tcp_nodelay on;
|
|
keepalive_timeout 65;
|
|
|
|
server {
|
|
listen 8888;
|
|
|
|
location /stat {
|
|
if ($request_method = "GET") {
|
|
add_header "Access-Control-Allow-Origin" *;
|
|
}
|
|
|
|
rtmp_stat all;
|
|
rtmp_stat_stylesheet stat.xsl;
|
|
}
|
|
location /json {
|
|
if ($request_method = "GET") {
|
|
add_header "Access-Control-Allow-Origin" *;
|
|
}
|
|
|
|
add_header Content-Type application/json;
|
|
rtmp_stat all;
|
|
rtmp_stat_stylesheet stat.xsl;
|
|
}
|
|
location /stat.xsl {
|
|
alias /var/www/html/stat.xsl;
|
|
}
|
|
|
|
location /hls {
|
|
alias /dev/shm/hls;
|
|
add_header Cache-Control no-cache;
|
|
add_header Access-Control-Allow-Origin *;
|
|
|
|
types {
|
|
application/vnd.apple.mpegurl m3u8;
|
|
video/mp2t ts;
|
|
}
|
|
}
|
|
}
|
|
} |