2018-08-31 17:21:46 +00:00
|
|
|
# This file was generated from funkwhale.template
|
2017-07-17 20:00:32 +00:00
|
|
|
|
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 ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT};
|
2017-06-25 21:02:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
2017-07-17 20:00:32 +00:00
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
|
|
|
# update this to match your instance name
|
2018-08-31 17:21:46 +00:00
|
|
|
server_name ${FUNKWHALE_HOSTNAME};
|
2017-07-17 20:00:32 +00:00
|
|
|
# useful for Let's Encrypt
|
|
|
|
location /.well-known/acme-challenge/ { allow all; }
|
|
|
|
location / { return 301 https://$host$request_uri; }
|
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 {
|
2019-01-22 10:37:54 +00:00
|
|
|
listen 443 ssl;
|
|
|
|
listen [::]:443 ssl;
|
2018-08-31 17:21:46 +00:00
|
|
|
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
|
|
|
ssl_protocols TLSv1.2;
|
|
|
|
ssl_ciphers HIGH:!MEDIUM:!LOW:!aNULL:!NULL:!SHA;
|
|
|
|
ssl_prefer_server_ciphers on;
|
|
|
|
ssl_session_cache shared:SSL:10m;
|
2018-08-31 17:21:46 +00:00
|
|
|
ssl_certificate /etc/letsencrypt/live/${FUNKWHALE_HOSTNAME}/fullchain.pem;
|
|
|
|
ssl_certificate_key /etc/letsencrypt/live/${FUNKWHALE_HOSTNAME}/privkey.pem;
|
2017-06-26 12:09:47 +00:00
|
|
|
# HSTS
|
|
|
|
add_header Strict-Transport-Security "max-age=31536000";
|
|
|
|
|
2018-08-31 17:21:46 +00:00
|
|
|
root ${FUNKWHALE_FRONTEND_PATH};
|
2017-06-25 21:02:36 +00:00
|
|
|
|
2018-12-19 22:46:53 +00:00
|
|
|
# compression settings
|
|
|
|
gzip on;
|
|
|
|
gzip_comp_level 5;
|
|
|
|
gzip_min_length 256;
|
|
|
|
gzip_proxied any;
|
|
|
|
gzip_vary on;
|
|
|
|
|
|
|
|
gzip_types
|
|
|
|
application/javascript
|
|
|
|
application/vnd.geo+json
|
|
|
|
application/vnd.ms-fontobject
|
|
|
|
application/x-font-ttf
|
|
|
|
application/x-web-app-manifest+json
|
|
|
|
font/opentype
|
|
|
|
image/bmp
|
|
|
|
image/svg+xml
|
|
|
|
image/x-icon
|
|
|
|
text/cache-manifest
|
|
|
|
text/css
|
|
|
|
text/plain
|
|
|
|
text/vcard
|
|
|
|
text/vnd.rim.location.xloc
|
|
|
|
text/vtt
|
|
|
|
text/x-component
|
|
|
|
text/x-cross-domain-policy;
|
|
|
|
|
|
|
|
# end of compression settings
|
2017-06-25 21:02:36 +00:00
|
|
|
location / {
|
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};
|
2018-12-19 13:04:26 +00:00
|
|
|
proxy_pass http://funkwhale-api/;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /front/ {
|
2018-12-19 14:35:23 +00:00
|
|
|
alias ${FUNKWHALE_FRONTEND_PATH}/;
|
2018-12-20 14:59:55 +00:00
|
|
|
expires 30d;
|
|
|
|
add_header Pragma public;
|
|
|
|
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
|
2017-06-25 21:02:36 +00:00
|
|
|
}
|
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_SERVE_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
|
|
|
}
|
|
|
|
}
|