forked from prophile/srcompbox-2015
-
Notifications
You must be signed in to change notification settings - Fork 4
/
nginx.conf.erb
64 lines (53 loc) · 1.54 KB
/
nginx.conf.erb
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
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
<% if @enable_tls %>
server_name <%= @www_hostname %>;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
listen [::]:443 ssl ipv6only=on;
server_name <%= @www_hostname %>;
ssl_certificate /etc/letsencrypt/live/<%= @www_hostname %>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<%= @www_hostname %>/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
<% else %>
server_name compbox;
<% end %>
index compbox-index.html;
root /var/www/html;
location / {
root /var/www/screens;
}
location /livestream-overlay/ {
root /var/www;
index stream.html;
}
location = /stream {
add_header Access-Control-Allow-Origin *;
return 307 /stream/;
}
location /stream/ {
proxy_pass http:https://localhost:5001/;
proxy_redirect default;
proxy_buffering off;
proxy_read_timeout 8m;
# The following config is required to proxy websockets
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
location = /monitor {
return 301 /monitor/;
}
location /monitor/ {
proxy_pass http:https://localhost:5002/;
proxy_buffering off;
proxy_read_timeout 20m;
}
location /comp-api {
proxy_pass http:https://localhost:5112;
}
}