Skip to content

Instantly share code, notes, and snippets.

@Code-Slave
Created August 28, 2018 01:05
Show Gist options
  • Save Code-Slave/5faa4b20dc4249cfaaa8f4c13fa645b6 to your computer and use it in GitHub Desktop.
Save Code-Slave/5faa4b20dc4249cfaaa8f4c13fa645b6 to your computer and use it in GitHub Desktop.
funkwhale
# Ensure you update at least the server_name variables to match your own
# domain
upstream funkwhale-api {
# depending on your setup, you may want to udpate this
server localhost:5000;
}
# required for websocket support
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
# update this to match your instance name
server_name my.domain.here;
# TLS
# 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
# don't want to run funkwhale behind https (this is not recommended)
# have a look here for let's encrypt configuration:
# https://certbot.eff.org/all-instructions/#debian-9-stretch-nginx
sslstuff removed
###ssl_session_cache shared:SSL:10m;
# HSTS
add_header Strict-Transport-Security "max-age=31536000";
root /config/www/fw/dist;
location / {
try_files $uri $uri/ @rewrites;
}
location @rewrites {
rewrite ^(.+)$ /index.html last;
}
location /api/ {
include /config/nginx/proxy.conf;
# this is needed if you have file import via upload enabled
client_max_body_size 30M;
proxy_pass http://funkwhale-api/api/;
}
location /federation/ {
include /config/nginx/proxy.conf;
proxy_pass http://funkwhale-api/federation/;
}
# You can comment this if you do not plan to use the Subsonic API
location /rest/ {
include /config/nginx/proxy.conf;
proxy_pass http://funkwhale-api/api/subsonic/rest/;
}
location /.well-known/ {
include /config/nginx/proxy.conf;
proxy_pass http://funkwhale-api/.well-known/;
}
location /media/ {
alias /srv/funkwhale/data/media/;
}
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 /srv/funkwhale/data/media;
}
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 /music;
}
location /staticfiles/ {
# django static files
alias /config/www/fw/static;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment