forked from 1424234500/help_note_20190602
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
95 lines (70 loc) · 2.07 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
#user nobody;
worker_processes 1;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
rtmp { # 配置RTMP模块
server { # 服务器
listen 1935; # 监听端口, 默认为1935
chunk_size 4000; # 数据块大小 4000
application hls {
live on;
hls on;
hls_path /home/file/hls; #文件存放地址,/tmp/hls
}
application myapp { # 应用名称, 可理解为直播房间的名称
live on; # 直播 [on]开启
record_max_frames 0;
}
}
}
http {
include 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 logs/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
gzip on;
#Tomcat
upstream base {
server 127.0.0.1:8085 weight=1;
}
#RaspBerry python tornado
upstream python {
server 127.0.0.1:8086 weight=1;
}
#RaspBerry python socket
upstream socket {
server 127.0.0.1:8087 weight=1;
}
server {
listen 8088;
server_name localhost;
# rtmp hls http直播
location /hls {
types {
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /home/file/;
add_header Cache-Control no-cache;
}
location /do {
proxy_pass http://python;
}
location /BaseSSM {
proxy_pass http://base;
}
location /file {
root /home;
}
}
}