Files
muzick/frontend/nginx.conf.template
T
kami 4ead344aec feat(playback): move a session between devices
One device holds the audio; the rest watch the same session over an
event stream and act as remotes. Picking a device hands the audio over
at the position the previous one reported, and that device stops.

Also centre the command palette with margins instead of a translate:
animate-rise sets its own transform and dropped the offset on mobile.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-08 19:12:26 +04:00

47 lines
1.6 KiB
Plaintext

server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
# Admin endpoints need the admin key, not the regular API key. This prefix
# location is longer than "/api", and nginx picks the longest matching
# prefix location, so it wins for /api/admin/* while /api handles the rest.
location /api/admin/ {
proxy_pass http://backend:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header Authorization "Bearer ${MUZICK_ADMIN_KEY}";
proxy_cache_bypass $http_upgrade;
}
# The cross-device event stream is long-lived and must arrive unbuffered:
# with proxy buffering on, nginx holds each event until it has a chunk worth
# forwarding, which is exactly the latency this channel exists to avoid.
location /api/playback/stream {
proxy_pass http://backend:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Authorization "Bearer ${MUZICK_API_KEY}";
proxy_set_header Connection '';
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 1h;
}
location /api {
proxy_pass http://backend:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header Authorization "Bearer ${MUZICK_API_KEY}";
proxy_cache_bypass $http_upgrade;
}
}