2023-03-24 12:21:19 +01:00
|
|
|
root __INSTALL_DIR__/front/dist;
|
2021-04-24 13:05:22 +02:00
|
|
|
|
2019-02-15 06:46:40 +01:00
|
|
|
location / {
|
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;
|
|
|
|
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";
|
2023-03-24 12:21:19 +01:00
|
|
|
alias __INSTALL_DIR__/front/dist/;
|
2021-04-24 13:05:22 +02:00
|
|
|
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";
|
2023-03-24 12:21:19 +01:00
|
|
|
alias __INSTALL_DIR__/front/dist/embed.html;
|
2021-04-24 13:05:22 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
|
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-03-19 20:49:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
location /media/attachments/ {
|
2023-03-31 13:19:41 +02:00
|
|
|
alias __DATA_DIR__/data/media/attachments/;
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
2022-01-07 00:15:33 +01:00
|
|
|
location /_protected/media/ {
|
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
|
|
|
|
internal;
|
2023-03-31 13:19:41 +02:00
|
|
|
alias __DATA_DIR__/data/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;
|
|
|
|
# }
|
|
|
|
|
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/;
|
2018-04-17 00:02:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
location /staticfiles/ {
|
2021-04-24 13:05:22 +02:00
|
|
|
# django static files
|
2023-03-31 13:19:41 +02:00
|
|
|
alias __DATA_DIR__/data/static/;
|
2019-08-28 23:50:20 +02:00
|
|
|
}
|