-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
117 lines (82 loc) · 2.74 KB
/
nginx.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
worker_processes auto;
events {
worker_connections 1024;
}
# RTMP configuration
rtmp {
server {
listen 1935; # Listen on standard RTMP port
chunk_size 4096;
application live{
live on;
# Turn on HLS
allow publish all;
# allow publish 127.0.0.1;
hls on;
hls_path /usr/local/nginx/stream_data/stream_cache/hls;
hls_playlist_length 10m;
dash on;
dash_playlist_length 10m;
dash_path /usr/local/nginx/stream_data/stream_cache/dash;
#record streams
record all;
record_path /usr/local/nginx/stream_data/playbacks;
record_suffix -%d-%b-%y-%T.flv;
record_unique on;
# disable consuming the stream from nginx as rtmp
deny play all;
}
}
}
http {
# include mime.types;
# sendfile on;
default_type application/octet-stream;
server {
listen 8080;
# server_name localhost;
root /;
location / {
root /usr/local/nginx/html/;
index index.html;
add_header 'Cache-Control' 'no-cache';
}
location /hls {
root /usr/local/nginx/stream_data/stream_cache;
# Disable caches
add_header 'Cache-Control' 'no-cache';
# CORS setup
add_header 'Access-Control-Allow-Origin' '*' always;
types {
application/vnd.apple.mpegurl m3u8;
audio/mpeg mp3;
audio/x-realaudio ra;
video/mp2t ts;
video/mpeg mpeg mpg;
video/quicktime mov;
video/x-flv flv;
video/x-msvideo avi;
text/html html;
}
}
location /dash {
root /usr/local/nginx/stream_data/stream_cache;
# Serve DASH fragments
# Disable cache
add_header Cache-Control no-cache;
# CORS setup
add_header 'Access-Control-Allow-Origin' '*' always;
types {
application/vnd.apple.mpegurl m3u8;
audio/mpeg mp3;
audio/x-realaudio ra;
video/mp2t ts;
video/mpeg mpeg mpg;
video/quicktime mov;
video/x-flv flv;
video/x-msvideo avi;
text/html html;
}
}
}
}