-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathnginx.tmpl
31 lines (28 loc) · 1.42 KB
/
nginx.tmpl
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
server {
listen 80;
location / {
sub_filter '<html>' '<html style="background-image: linear-gradient(to right, ${BG_GRADIENT});">';
sub_filter '<head>' '<head><link rel="icon" href="${FAVICON_URL}">';
sub_filter '<title>broadway 2.0</title>' '<title>${APP_TITLE}</title>';
sub_filter '</body>' '<img src="${CORNER_IMAGE_URL}" style="position: fixed;width: 256px;height: 256px;/*! z-index: 1000; *//*! display: block; */bottom: 0px;right: 30px;"><a target="_blank" href="/ttyd"><img src="/images/terminal-outline.svg" style="position: fixed;width: 64px;height: 64px;/*! z-index: 1000; *//*! display: block; */bottom: 30px;left: 30px;${TERM_COLOR}"></a></body>';
proxy_pass http://127.0.0.1:8085;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# workaround for broadwayd bug which use case sensitive comparison for HTTP header
proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
}
location ~ ^/ttyd(.*)$ {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass http://127.0.0.1:7681/$1;
}
location /images {
root /www/data;
try_files $uri $uri/ =404;
}
}