2017-06-25 21:02:36 +00:00
|
|
|
upstream funkwhale-api {
|
2018-09-13 15:31:06 +00:00
|
|
|
# depending on your setup, you may want to update this
|
2018-08-31 17:21:46 +00:00
|
|
|
server api:5000;
|
2017-06-25 21:02:36 +00:00
|
|
|
}
|
|
|
|
|
2017-06-26 12:09:47 +00:00
|
|
|
|
2018-03-03 22:18:33 +00:00
|
|
|
# required for websocket support
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
|
|
default upgrade;
|
|
|
|
'' close;
|
|
|
|
}
|
|
|
|
|
2017-06-26 12:09:47 +00:00
|
|
|
server {
|
2018-08-31 17:21:46 +00:00
|
|
|
listen 80;
|
|
|
|
server_name ${FUNKWHALE_HOSTNAME};
|
2017-06-25 21:02:36 +00:00
|
|
|
|
2017-06-26 12:09:47 +00:00
|
|
|
# TLS
|
2017-07-17 20:00:32 +00:00
|
|
|
# Feel free to use your own configuration for SSL here or simply remove the
|
|
|
|
# lines and move the configuration to the previous server block if you
|
2018-06-25 21:48:28 +00:00
|
|
|
# don't want to run funkwhale behind https (this is not recommended)
|
2017-07-17 20:00:32 +00:00
|
|
|
# have a look here for let's encrypt configuration:
|
|
|
|
# https://certbot.eff.org/all-instructions/#debian-9-stretch-nginx
|
2017-06-26 12:09:47 +00:00
|
|
|
|
2018-08-31 17:21:46 +00:00
|
|
|
root /frontend;
|
2017-06-25 21:02:36 +00:00
|
|
|
|
|
|
|
location / {
|
|
|
|
try_files $uri $uri/ @rewrites;
|
|
|
|
}
|
|
|
|
|
|
|
|
location @rewrites {
|
|
|
|
rewrite ^(.+)$ /index.html last;
|
|
|
|
}
|
|
|
|
location /api/ {
|
2018-03-04 15:58:37 +00:00
|
|
|
include /etc/nginx/funkwhale_proxy.conf;
|
2017-12-27 22:32:02 +00:00
|
|
|
# this is needed if you have file import via upload enabled
|
2018-08-31 17:21:46 +00:00
|
|
|
client_max_body_size ${NGINX_MAX_BODY_SIZE};
|
2017-06-25 21:02:36 +00:00
|
|
|
proxy_pass http://funkwhale-api/api/;
|
|
|
|
}
|
2018-02-19 19:20:49 +00:00
|
|
|
|
2018-03-29 21:38:33 +00:00
|
|
|
location /federation/ {
|
|
|
|
include /etc/nginx/funkwhale_proxy.conf;
|
|
|
|
proxy_pass http://funkwhale-api/federation/;
|
|
|
|
}
|
|
|
|
|
2018-05-29 16:12:46 +00:00
|
|
|
# You can comment this if you do not plan to use the Subsonic API
|
|
|
|
location /rest/ {
|
|
|
|
include /etc/nginx/funkwhale_proxy.conf;
|
|
|
|
proxy_pass http://funkwhale-api/api/subsonic/rest/;
|
|
|
|
}
|
|
|
|
|
2018-05-07 20:29:22 +00:00
|
|
|
location /.well-known/ {
|
2018-03-29 21:38:33 +00:00
|
|
|
include /etc/nginx/funkwhale_proxy.conf;
|
2018-05-07 20:29:22 +00:00
|
|
|
proxy_pass http://funkwhale-api/.well-known/;
|
2018-03-29 21:38:33 +00:00
|
|
|
}
|
|
|
|
|
2017-06-25 21:02:36 +00:00
|
|
|
location /media/ {
|
2018-08-31 17:21:46 +00:00
|
|
|
alias ${MEDIA_ROOT}/;
|
2017-06-25 21:02:36 +00:00
|
|
|
}
|
2017-06-28 21:30:26 +00:00
|
|
|
|
2018-06-19 08:13:34 +00: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;
|
2018-08-31 17:21:46 +00:00
|
|
|
alias ${MEDIA_ROOT};
|
2018-06-19 08:13:34 +00:00
|
|
|
}
|
|
|
|
|
2018-04-21 17:30:55 +00:00
|
|
|
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
|
2018-06-10 20:51:24 +00:00
|
|
|
# Set this to the same value as your MUSIC_DIRECTORY_PATH setting
|
2018-04-21 17:30:55 +00:00
|
|
|
internal;
|
2018-08-31 17:21:46 +00:00
|
|
|
alias ${MUSIC_DIRECTORY_PATH};
|
2018-04-21 17:30:55 +00:00
|
|
|
}
|
|
|
|
|
2017-06-25 21:02:36 +00:00
|
|
|
location /staticfiles/ {
|
2017-06-28 21:30:26 +00:00
|
|
|
# django static files
|
2018-08-31 17:21:46 +00:00
|
|
|
alias ${STATIC_ROOT}/;
|
2017-06-25 21:02:36 +00:00
|
|
|
}
|
|
|
|
}
|