2023-06-03 22:19:41 +02:00
|
|
|
root __INSTALL_DIR__/front/dist;
|
2021-04-24 13:05:22 +02:00
|
|
|
|
2023-06-03 21:25:40 +02:00
|
|
|
location /api/ {
|
2021-04-24 13:05:22 +02:00
|
|
|
|
|
|
|
# global proxy conf
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
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_set_header X-Forwarded-Host $host:$server_port;
|
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
proxy_redirect off;
|
|
|
|
|
|
|
|
# websocket support
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
|
|
|
|
# this is needed if you have file import via upload enabled
|
|
|
|
client_max_body_size 100M;
|
2023-06-03 21:25:40 +02:00
|
|
|
proxy_pass http://127.0.0.1:__PORT__;
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
2023-06-03 21:25:40 +02:00
|
|
|
location / {
|
2023-06-03 22:19:41 +02:00
|
|
|
alias __INSTALL_DIR__/front/dist/;
|
2023-06-03 21:25:40 +02:00
|
|
|
expires 1d;
|
|
|
|
try_files $uri $uri/ /index.html;
|
2019-10-31 18:25:28 +01:00
|
|
|
}
|
|
|
|
|
2023-06-03 21:25:40 +02:00
|
|
|
location /embed.html {
|
2023-06-04 09:03:47 +02:00
|
|
|
more_set_headers "Content-Security-Policy: connect-src https: http: 'self'; default-src 'self'; script-src 'self' unpkg.com 'unsafe-inline' 'unsafe-eval'; style-src https: http: 'self' 'unsafe-inline'; img-src https: http: 'self' data:; font-src https: http: 'self' data:; object-src 'none'; media-src https: http: 'self' data:";
|
2023-06-04 09:24:50 +02:00
|
|
|
more_set_headers "Referrer-Policy: strict-origin-when-cross-origin";
|
2021-04-24 13:05:22 +02:00
|
|
|
|
2023-06-03 22:19:41 +02:00
|
|
|
alias __INSTALL_DIR__/front/dist/embed.html;
|
2023-06-03 21:25:40 +02:00
|
|
|
expires 1d;
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
location /federation/ {
|
|
|
|
|
2021-04-24 13:05:22 +02:00
|
|
|
# global proxy conf
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
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_set_header X-Forwarded-Host $host:$server_port;
|
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
proxy_redirect off;
|
2019-02-15 06:46:40 +01:00
|
|
|
|
2021-04-24 13:05:22 +02:00
|
|
|
# websocket support
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
|
|
|
|
proxy_pass http://127.0.0.1:__PORT__/federation/;
|
2019-02-15 06:46:40 +01:00
|
|
|
}
|
|
|
|
|
2021-04-24 13:05:22 +02:00
|
|
|
# You can comment this if you do not plan to use the Subsonic API
|
|
|
|
location /rest/ {
|
|
|
|
|
|
|
|
# global proxy conf
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
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_set_header X-Forwarded-Host $host:$server_port;
|
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
proxy_redirect off;
|
|
|
|
|
|
|
|
# websocket support
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
|
|
|
|
proxy_pass http://127.0.0.1:__PORT__/api/subsonic/rest/;
|
|
|
|
}
|
2019-02-15 06:46:40 +01:00
|
|
|
|
2018-05-10 18:54:23 +02:00
|
|
|
location /.well-known/ {
|
2021-04-24 13:05:22 +02:00
|
|
|
|
|
|
|
# global proxy conf
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
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_set_header X-Forwarded-Host $host:$server_port;
|
|
|
|
proxy_set_header X-Forwarded-Port $server_port;
|
|
|
|
proxy_redirect off;
|
|
|
|
|
|
|
|
# websocket support
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
|
2023-06-03 21:25:40 +02:00
|
|
|
proxy_pass http://127.0.0.1:__PORT__;
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
2023-03-19 20:49:52 +01:00
|
|
|
location /media/__sized__/ {
|
2023-03-31 13:19:41 +02:00
|
|
|
alias __DATA_DIR__/data/media/__sized__/;
|
2023-06-04 09:24:50 +02:00
|
|
|
more_set_headers "Access-Control-Allow-Origin: *";
|
2023-03-19 20:49:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
location /media/attachments/ {
|
2023-03-31 13:19:41 +02:00
|
|
|
alias __DATA_DIR__/data/media/attachments/;
|
2023-06-04 09:24:50 +02:00
|
|
|
more_set_headers "Access-Control-Allow-Origin: *";
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
2023-06-10 21:24:54 +02:00
|
|
|
# This is an internal location that is used to serve
|
|
|
|
# media (uploaded) files once correct permission / authentication
|
|
|
|
# has been checked on API side.
|
|
|
|
# Comment the "NON-S3" commented lines and uncomment "S3" commented lines
|
|
|
|
# if you're storing media files in a S3 bucket.
|
2023-06-19 13:18:01 +02:00
|
|
|
location /_protected/media/ {
|
2023-06-10 21:24:54 +02:00
|
|
|
internal;
|
2023-06-10 21:36:13 +02:00
|
|
|
alias __DATA_DIR__/data/media/$1; # NON-S3
|
2023-06-10 21:24:54 +02:00
|
|
|
# Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932.
|
2023-06-10 21:32:32 +02:00
|
|
|
# proxy_set_header Authorization ""; # S3
|
|
|
|
# proxy_pass $1; # S3
|
|
|
|
more_set_headers "Access-Control-Allow-Origin: *";
|
|
|
|
}
|
2021-04-24 13:05:22 +02:00
|
|
|
|
2022-01-07 00:15:33 +01:00
|
|
|
location /_protected/music/ {
|
2021-04-24 13:05:22 +02:00
|
|
|
# this is an internal location that is used to serve
|
|
|
|
# audio files once correct permission / authentication
|
|
|
|
# has been checked on API side
|
|
|
|
# Set this to the same value as your MUSIC_DIRECTORY_PATH setting
|
|
|
|
internal;
|
2023-03-31 13:19:41 +02:00
|
|
|
alias __DATA_DIR__/data/music/;
|
2023-06-04 09:24:50 +02:00
|
|
|
more_set_headers "Access-Control-Allow-Origin: *";
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
2023-06-06 22:20:18 +02:00
|
|
|
# Allow direct access to /staticfiles
|
|
|
|
location /staticfiles/ {
|
|
|
|
alias __DATA_DIR__/data/static/;
|
|
|
|
more_set_headers "Access-Control-Allow-Origin: *";
|
|
|
|
}
|
|
|
|
|
|
|
|
# Allow direct access to only specific subdirectories in /media
|
|
|
|
location /media/dynamic_preferences/ {
|
|
|
|
alias __DATA_DIR__/data/media/dynamic_preferences/;
|
|
|
|
more_set_headers "Access-Control-Allow-Origin: *";
|
|
|
|
}
|
|
|
|
|
2023-06-03 21:25:40 +02:00
|
|
|
location /manifest.json {
|
|
|
|
return 302 /api/v1/instance/spa-manifest.json;
|
2019-08-28 23:50:20 +02:00
|
|
|
}
|