2017-06-23 21:00:42 +00:00
|
|
|
user nginx;
|
|
|
|
worker_processes 1;
|
|
|
|
|
|
|
|
error_log /var/log/nginx/error.log warn;
|
|
|
|
pid /var/run/nginx.pid;
|
|
|
|
|
|
|
|
|
|
|
|
events {
|
|
|
|
worker_connections 1024;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
http {
|
|
|
|
include /etc/nginx/mime.types;
|
|
|
|
default_type application/octet-stream;
|
|
|
|
|
|
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
|
|
'"$http_user_agent" "$http_x_forwarded_for"';
|
|
|
|
|
|
|
|
access_log /var/log/nginx/access.log main;
|
|
|
|
|
|
|
|
sendfile on;
|
|
|
|
#tcp_nopush on;
|
|
|
|
|
|
|
|
keepalive_timeout 65;
|
|
|
|
|
|
|
|
#gzip on;
|
|
|
|
|
2018-02-25 12:05:01 +00:00
|
|
|
map $http_upgrade $connection_upgrade {
|
|
|
|
default upgrade;
|
|
|
|
'' close;
|
|
|
|
}
|
|
|
|
|
2018-12-19 13:03:21 +00:00
|
|
|
upstream funkwhale-api {
|
|
|
|
server ${FUNKWHALE_API_IP}:${FUNKWHALE_API_PORT};
|
|
|
|
}
|
|
|
|
upstream funkwhale-front {
|
|
|
|
server ${FUNKWHALE_FRONT_IP}:${FUNKWHALE_FRONT_PORT};
|
|
|
|
}
|
2017-06-23 21:00:42 +00:00
|
|
|
server {
|
2018-12-19 13:03:21 +00:00
|
|
|
listen 80;
|
2017-06-23 21:00:42 +00:00
|
|
|
charset utf-8;
|
2019-01-11 08:51:23 +00:00
|
|
|
client_max_body_size 100M;
|
2018-03-29 18:30:24 +00:00
|
|
|
include /etc/nginx/funkwhale_proxy.conf;
|
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;
|
2018-12-19 13:03:21 +00:00
|
|
|
|
|
|
|
location /front/ {
|
|
|
|
proxy_pass http://funkwhale-front/front/;
|
2017-06-23 21:00:42 +00:00
|
|
|
}
|
2018-12-19 13:03:21 +00:00
|
|
|
location /front-server/ {
|
|
|
|
proxy_pass http://funkwhale-front/;
|
2018-04-21 17:30:55 +00:00
|
|
|
}
|
2018-12-19 13:03:21 +00:00
|
|
|
|
2018-02-18 22:50:23 +00:00
|
|
|
location / {
|
2018-03-29 18:30:24 +00:00
|
|
|
include /etc/nginx/funkwhale_proxy.conf;
|
2018-12-19 13:03:21 +00:00
|
|
|
# this is needed if you have file import via upload enabled
|
|
|
|
client_max_body_size ${NGINX_MAX_BODY_SIZE};
|
|
|
|
proxy_pass http://funkwhale-api/;
|
2017-06-23 21:00:42 +00:00
|
|
|
}
|
2018-12-19 13:03:21 +00:00
|
|
|
|
|
|
|
# You can comment this if you do not plan to use the Subsonic API
|
2018-05-09 18:38:26 +00:00
|
|
|
location /rest/ {
|
|
|
|
include /etc/nginx/funkwhale_proxy.conf;
|
2018-12-19 13:03:21 +00:00
|
|
|
proxy_pass http://funkwhale-api/api/subsonic/rest/;
|
|
|
|
}
|
|
|
|
|
|
|
|
location /media/ {
|
|
|
|
alias /protected/media/;
|
|
|
|
}
|
|
|
|
|
2019-04-23 16:00:00 +00:00
|
|
|
# this is an internal location that is used to serve
|
|
|
|
# audio files once correct permission / authentication
|
|
|
|
# has been checked on API side
|
2018-12-19 13:03:21 +00:00
|
|
|
location /_protected/media {
|
|
|
|
internal;
|
|
|
|
alias /protected/media;
|
2019-04-23 16:00:00 +00:00
|
|
|
|
2018-12-19 13:03:21 +00:00
|
|
|
}
|
2019-04-23 16:00:00 +00:00
|
|
|
# Comment the previous location and uncomment this one if you're storing
|
|
|
|
# media files in a S3 bucket
|
|
|
|
# location ~ /_protected/media/(.+) {
|
|
|
|
# internal;
|
|
|
|
# resolver 127.0.0.11;
|
|
|
|
# proxy_pass $1;
|
2019-04-24 10:56:15 +00:00
|
|
|
# add_header X-Remote-URL "$1";
|
2019-04-23 16:00:00 +00:00
|
|
|
# }
|
2018-12-19 13:03:21 +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
|
|
|
|
# Set this to the same value as your MUSIC_DIRECTORY_PATH setting
|
|
|
|
internal;
|
|
|
|
alias /music;
|
2018-05-09 18:38:26 +00:00
|
|
|
}
|
2017-06-23 21:00:42 +00:00
|
|
|
}
|
|
|
|
}
|