This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathnginx.conf
176 lines (151 loc) · 4.67 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
user root;
worker_processes 1;
daemon off;
load_module modules/ngx_http_qatzip_filter_module.so;
load_module modules/ngx_ssl_engine_qat_module.so;
events {
worker_connections 4096;
}
# Enable QAT engine in heretic mode.
ssl_engine {
use_engine qatengine;
default_algorithms RSA,EC,DH,DSA;
qat_engine {
qat_offload_mode async;
qat_notify_mode poll;
qat_poll_mode heuristic;
#qat_sw_fallback on;
}
}
# Configure RTMP
rtmp {
server {
listen 1935;
chunk_size 4000;
application stream {
live on;
}
application hls {
live on;
hls on;
hls_path /var/www/hls;
hls_nested on;
hls_fragment 3;
hls_playlist_length 60;
}
application dash {
live on;
dash on;
dash_path /var/www/dash;
dash_fragment 3;
dash_playlist_length 60;
dash_nested on;
}
}
}
http {
gzip on;
gzip_min_length 128;
gzip_comp_level 1;
gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/json application/xml application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml;
gzip_vary on;
gzip_disable "msie6";
gzip_http_version 1.0;
qatzip_sw failover;
qatzip_min_length 128;
qatzip_comp_level 1;
qatzip_buffers 16 8k;
qatzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/json application/xml application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml application/octet-stream image/jpeg;
qatzip_chunk_size 64k;
qatzip_stream_size 256k;
qatzip_sw_threshold 256;
# HTTP server with QATZip enabled.
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
location /hls {
alias /var/www/hls;
add_header Cache-Control no-cache;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length';
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
}
location /dash {
alias /var/www/dash;
add_header Cache-Control no-cache;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length';
types {
application/dash+xml mpd;
}
}
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /upload {
client_max_body_size 1024M;
upload_pass @upload;
upload_pass_args on;
upload_store /var/www/upload;
upload_set_form_field $upload_field_name.path "$upload_tmp_path";
upload_cleanup 400 404 499 500-505;
}
location @upload {
return 200;
}
}
# HTTPS server with QATZip enabled.
server {
listen 443 ssl asynch;
server_name localhost;
ssl_protocols TLSv1.2;
ssl_certificate cert.crt;
ssl_certificate_key cert.key;
location / {
root html;
index index.html index.htm;
}
location /hls {
alias /var/www/hls;
add_header Cache-Control no-cache;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length';
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
}
location /dash {
alias /var/www/dash;
add_header Cache-Control no-cache;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length';
types {
application/dash+xml mpd;
}
}
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /upload {
client_max_body_size 1024M;
upload_pass @upload;
upload_pass_args on;
upload_store /var/www/upload;
upload_set_form_field $upload_field_name.path "$upload_tmp_path";
upload_cleanup 400 404 499 500-505;
}
location @upload {
return 200;
}
}
}