-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.conf
More file actions
68 lines (56 loc) · 1.58 KB
/
Copy pathmain.conf
File metadata and controls
68 lines (56 loc) · 1.58 KB
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
worker_processes auto;
events {
worker_connections 1024;
multi_accept on;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 8080;
# WEBSOCKET
location ^~ /api/ws/ {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 86400;
proxy_send_timeout 86400;
}
# HTTP API
location /api/ {
proxy_pass http://127.0.0.1:5000;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
}
# INTERNAL STREAMS (X-Accel)
location /internal_streams/ {
internal;
alias html/streams/;
}
# PUBLIC STREAMS (опционально)
location /streams/ {
alias html/streams/;
etag off;
if_modified_since off;
add_header Cache-Control no-cache;
add_header Access-Control-Allow-Origin *;
}
# STATIC
location / {
root html;
autoindex on;
}
}
}