2021-04-24 13:05:22 +02:00
|
|
|
root __FINALPATH__/front/dist;
|
|
|
|
|
2019-02-15 06:46:40 +01:00
|
|
|
location / {
|
2021-04-24 13:05:22 +02:00
|
|
|
|
|
|
|
# Force usage of https
|
|
|
|
if ($scheme = http) {
|
|
|
|
rewrite ^ https://$server_name$request_uri? permanent;
|
|
|
|
}
|
|
|
|
|
|
|
|
# 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;
|
|
|
|
proxy_pass http://127.0.0.1:__PORT__/;
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
2019-01-26 20:00:47 +01:00
|
|
|
location /front/ {
|
2021-04-24 13:05:22 +02:00
|
|
|
more_set_headers "Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; object-src 'none'; media-src 'self' data:";
|
|
|
|
more_set_headers "Referrer-Policy: strict-origin-when-cross-origin";
|
|
|
|
more_set_headers "Service-Worker-Allowed: /";
|
|
|
|
more_set_headers "X-Frame-Options: SAMEORIGIN";
|
|
|
|
alias __FINALPATH__/front/dist/;
|
|
|
|
expires 30d;
|
|
|
|
more_set_headers "Pragma: public";
|
|
|
|
more_set_headers "Cache-Control: public, must-revalidate, proxy-revalidate";
|
2019-10-31 18:25:28 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
location /front/embed.html {
|
2021-04-24 13:05:22 +02:00
|
|
|
more_set_headers "Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self' data:; object-src 'none'; media-src 'self' data:";
|
|
|
|
more_set_headers "Referrer-Policy: strict-origin-when-cross-origin";
|
|
|
|
|
|
|
|
more_set_headers "X-Frame-Options: ALLOW";
|
|
|
|
alias __FINALPATH__/front/dist/embed.html;
|
|
|
|
expires 30d;
|
|
|
|
more_set_headers "Pragma: public";
|
|
|
|
more_set_headers "Cache-Control: public, must-revalidate, proxy-revalidate";
|
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;
|
|
|
|
|
|
|
|
proxy_pass http://127.0.0.1:__PORT__/.well-known/;
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
location /media/ {
|
2021-04-24 13:05:22 +02:00
|
|
|
alias __DATADIR__/media/;
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
2021-04-24 13:05:22 +02:00
|
|
|
location /_protected/media {
|
|
|
|
# this is an internal location that is used to serve
|
|
|
|
# audio files once correct permission / authentication
|
|
|
|
# has been checked on API side
|
|
|
|
internal;
|
|
|
|
alias __DATADIR__/media;
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
2021-04-24 13:05:22 +02:00
|
|
|
# Comment the previous location and uncomment this one if you're storing
|
|
|
|
# media files in a S3 bucket
|
|
|
|
# location ~ /_protected/media/(.+) {
|
|
|
|
# internal;
|
|
|
|
# # Needed to ensure DSub auth isn't forwarded to S3/Minio, see #932
|
|
|
|
# proxy_set_header Authorization "";
|
|
|
|
# proxy_pass $1;
|
|
|
|
# }
|
|
|
|
|
|
|
|
location /_protected/music {
|
|
|
|
# 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;
|
|
|
|
alias __DATADIR__/music;
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
location /staticfiles/ {
|
2021-04-24 13:05:22 +02:00
|
|
|
# django static files
|
|
|
|
alias __DATADIR__/static/;
|
2019-08-28 23:50:20 +02:00
|
|
|
}
|