-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathnginx_simple.conf
61 lines (50 loc) · 1.41 KB
/
nginx_simple.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
worker_processes auto;
rtmp_auto_push on;
events {}
rtmp {
server {
listen 1935;
chunk_size 4096; # default 4096
application live {
live on;
interleave on;
# access
# allow play 127.0.0.1;
# deny play all;
# hls
hls on;
hls_path /tmp/hls;
# hls_playlist_length 30s; # 可以回看的秒數 Defaults to 30 seconds.
# hls_fragment 1s; # 每個 .ts 視頻切片的時長。 Defaults to 5 seconds.
# 這邊通常我們會分流到不同的雲
}
}
}
http {
include mime.types;
default_type application/octet-stream;
keepalive_timeout 65;
server {
listen 80; # HTTP IPv4
listen [::]:80; # HTTP IPv6
location / {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /tmp/hls;
}
location /stat {
rtmp_stat all;
# Use this stylesheet to view XML as web page
# in browser
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
# XML stylesheet to view RTMP stats.
# Copy stat.xsl wherever you want
# and put the full directory path here
root html;
}
}
}