music: Use nginx role

This commit is contained in:
polyfloyd 2025-05-14 17:40:30 +02:00
parent 1d8e07bf04
commit 301529271d
5 changed files with 54 additions and 80 deletions

49
snippets/music-nginx.j2 Normal file
View file

@ -0,0 +1,49 @@
{% for range in trusted_ranges %}
allow {{ range.cidr }};
{% endfor %}
deny all;
location / {
rewrite ^/(.*) https://{{ music_domain }}/trollibox/player/space?;
}
location /trollibox/ {
proxy_pass http://[::1]:3000/;
include proxy_params;
}
location ~ ^/trollibox/(.+/events)$ {
proxy_pass http://[::1]:3000/$1;
include proxy_params;
proxy_http_version 1.1;
chunked_transfer_encoding off;
add_header X-Test "123";
proxy_set_header Connection '';
proxy_buffering off;
proxy_read_timeout 7d;
}
location ~ ^/trollibox/(.+/listen)$ {
proxy_pass http://[::1]:3000/$1;
include proxy_params;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 7d;
}
location /bobdsp/ {
proxy_pass http://[::1]:8081/;
include proxy_params;
}
location /vis/ {
allow all;
proxy_pass http://[::1]:13378/;
include proxy_params;
}
location = /vis/ {
rewrite ^(.*)$ /vis/index.html;
include proxy_params;
}