-
Notifications
You must be signed in to change notification settings - Fork 18
/
nginx-sample.conf
61 lines (49 loc) · 1.45 KB
/
nginx-sample.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
# Run NGNIX as micboard user
user micboard staff;
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;
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# Direct proxy to micboard instance for venue-a
upstream micboard-venue-a {
server localhost:8080;
}
server {
listen 80;
proxy_connect_timeout 7d;
proxy_send_timeout 7d;
proxy_read_timeout 7d;
sendfile on;
sendfile_max_chunk 512k;
# Direct NGINX to host all items from /static
location ~ ^/[a-zA-Z]+/static/(.+)$ {
alias "/home/micboard/micboard/static/$1";
}
# Direct NGINX to host background assets
location ~ ^/[a-zA-Z]+/bg/(.+)$ {
alias "/home/micboard/.local/share/micboard/backgrounds/$1";
}
# Proxy /venue-a/ to updtream micboard server
location /venue-a/ {
proxy_pass http://micboard-venue-a;
rewrite /venue-a/(.*) /$1 break;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location / {
root "/home/micboard/micboard/static/";
index multivenue.html;
}
}
include servers/*;
}