2020-02-03 20:50:04 +00:00
|
|
|
|
2020-02-05 13:28:11 +00:00
|
|
|
user http;
|
2020-02-03 20:50:04 +00:00
|
|
|
worker_processes auto;
|
|
|
|
|
|
|
|
error_log /var/log/nginx/error.log warn;
|
|
|
|
pid /var/run/nginx.pid;
|
|
|
|
|
2020-02-05 13:28:11 +00:00
|
|
|
load_module /usr/lib/nginx/modules/ngx_rtmp_module.so;
|
2020-02-03 20:50:04 +00:00
|
|
|
|
|
|
|
events {
|
|
|
|
worker_connections 1024;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
http {
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
|
|
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
|
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
|
|
access_log /var/log/nginx/access.log main;
|
|
|
|
|
|
|
|
sendfile on;
|
|
|
|
keepalive_timeout 65;
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 80 default_server;
|
|
|
|
server_name localhost;
|
|
|
|
|
|
|
|
types {
|
|
|
|
application/vnd.apple.mpegurl m3u8;
|
|
|
|
}
|
|
|
|
|
|
|
|
root /data;
|
|
|
|
|
|
|
|
add_header Cache-Control no-cache;
|
|
|
|
add_header Access-Control-Allow-Origin *;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rtmp {
|
2020-02-05 13:28:11 +00:00
|
|
|
access_log off;
|
|
|
|
|
2020-02-03 20:50:04 +00:00
|
|
|
server {
|
|
|
|
listen 1935;
|
|
|
|
|
|
|
|
application hls {
|
|
|
|
live on;
|
|
|
|
|
|
|
|
hls on;
|
2020-02-03 21:43:22 +00:00
|
|
|
hls_fragment 15s;
|
2020-02-03 20:50:04 +00:00
|
|
|
hls_fragment_naming system;
|
|
|
|
hls_fragment_slicing aligned;
|
|
|
|
hls_path /data;
|
|
|
|
hls_playlist_length 24h;
|
|
|
|
hls_nested on;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|