123 lines
3.5 KiB
Plaintext
123 lines
3.5 KiB
Plaintext
server {
|
|
listen 80;
|
|
root /usr/share/nginx/html;
|
|
index links.html;
|
|
resolver 127.0.0.11 valid=30s ipv6=off;
|
|
set $relay_upstream ${RELAY_UPSTREAM};
|
|
set $caption_upstream ${CAPTION_UPSTREAM};
|
|
|
|
location ~ /\. {
|
|
return 404;
|
|
}
|
|
|
|
location = / {
|
|
try_files /links.html =404;
|
|
}
|
|
|
|
location ~ ^/room/([A-Za-z0-9_-]+)/edit/?$ {
|
|
try_files /editor.html =404;
|
|
}
|
|
|
|
location ~ ^/room/[A-Za-z0-9_-]+/?$ {
|
|
try_files /room.html =404;
|
|
}
|
|
|
|
location ~ ^/watch/[A-Za-z0-9_-]+/?$ {
|
|
try_files /watch.html =404;
|
|
}
|
|
|
|
location /api/ {
|
|
proxy_pass http://$caption_upstream;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Host 127.0.0.1:8765;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
proxy_read_timeout 120s;
|
|
}
|
|
|
|
location = /health {
|
|
proxy_pass http://$caption_upstream;
|
|
proxy_set_header Host 127.0.0.1:8765;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
|
|
location = /relay-config {
|
|
proxy_pass http://$caption_upstream;
|
|
proxy_set_header Host 127.0.0.1:8765;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
|
|
location = /transcribe {
|
|
proxy_pass http://$caption_upstream;
|
|
proxy_http_version 1.1;
|
|
client_max_body_size 5m;
|
|
proxy_set_header Host 127.0.0.1:8765;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_read_timeout 120s;
|
|
}
|
|
|
|
location /streams/ {
|
|
proxy_pass http://$caption_upstream;
|
|
proxy_http_version 1.1;
|
|
client_max_body_size 5m;
|
|
proxy_set_header Host 127.0.0.1:8765;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_read_timeout 120s;
|
|
}
|
|
|
|
location /v1/ {
|
|
proxy_pass http://$caption_upstream;
|
|
proxy_http_version 1.1;
|
|
client_max_body_size 5m;
|
|
proxy_set_header Host 127.0.0.1:8765;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_read_timeout 120s;
|
|
}
|
|
|
|
location /static/ {
|
|
proxy_pass http://$caption_upstream;
|
|
proxy_set_header Host 127.0.0.1:8765;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
|
|
location = /capture-local.html {
|
|
proxy_pass http://$caption_upstream;
|
|
proxy_set_header Host 127.0.0.1:8765;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
|
|
location = /admin.html {
|
|
proxy_pass http://$caption_upstream;
|
|
proxy_set_header Host 127.0.0.1:8765;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
}
|
|
|
|
location = /site-config.js {
|
|
default_type application/javascript;
|
|
add_header Cache-Control "no-store";
|
|
return 200 'window.CAPTIONS_SITE = {relay: "${RELAY_URL}", capture: "${CAPTURE_URL}"};\n';
|
|
}
|
|
|
|
location /models/ {
|
|
alias /usr/share/nginx/models/;
|
|
}
|
|
|
|
location = /ws {
|
|
proxy_pass http://$relay_upstream/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_read_timeout 3600s;
|
|
}
|
|
|
|
location / {
|
|
try_files $uri $uri.html $uri/ /links.html;
|
|
}
|
|
}
|