# Following variables MUST be modified according to your setup Define funquail-sn funquail.yourdomain.com # Following variables should be modified according to your setup and if you # use different configuration than what is described in our installation guide. Define funquail-api http://localhost:5000 Define funquail-api-ws ws://localhost:5000 Define FUNQUAIL_ROOT_PATH /srv/funquail Define MUSIC_DIRECTORY_PATH ${FUNQUAIL_ROOT_PATH}/data/music Define MEDIA_DIRECTORY_PATH ${FUNQUAIL_ROOT_PATH}/data/media # HTTP requests redirected to HTTPS ServerName ${funquail-sn} # Default is to force https RewriteEngine on RewriteCond %{SERVER_NAME} =${funquail-sn} RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent] Options None Require all granted ServerName ${funquail-sn} # Path to ErrorLog and access log ErrorLog ${APACHE_LOG_DIR}/funquail/error.log CustomLog ${APACHE_LOG_DIR}/funquail/access.log combined # 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 funquail behind https (this is not recommended) # have a look here for let's encrypt configuration: # https://certbot.eff.org/lets-encrypt/debianstretch-apache.html SSLEngine on SSLProxyEngine On SSLCertificateFile /etc/letsencrypt/live/${funquail-sn}/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/${funquail-sn}/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf # Tell the api that the client is using https RequestHeader set X-Forwarded-Proto "https" # Configure Proxy settings # ProxyPreserveHost pass the original Host header to the backend server ProxyVia On ProxyPreserveHost On RemoteIPHeader X-Forwarded-For # Turning ProxyRequests on and allowing proxying from all may allow # spammers to use your proxy to send e-mail. ProxyRequests Off AddDefaultCharset off Order Allow,Deny Allow from all # similar to nginx 'client_max_body_size 100M;' LimitRequestBody 104857600 ProxyPass ${funquail-api}/ ProxyPassReverse ${funquail-api}/ ProxyPass ${funquail-api}/federation ProxyPassReverse ${funquail-api}/federation # You can comment this if you don't plan to use the Subsonic API ProxyPass ${funquail-api}/api/subsonic/rest ProxyPassReverse ${funquail-api}/api/subsonic/rest ProxyPass ${funquail-api}/.well-known/ ProxyPassReverse ${funquail-api}/.well-known/ ProxyPass "!" Alias /front ${FUNQUAIL_ROOT_PATH}/front/dist ProxyPass "!" Alias /assets ${FUNQUAIL_ROOT_PATH}/front/dist/assets ProxyPass "!" Alias /media ${MEDIA_DIRECTORY_PATH} ProxyPass "!" Alias /staticfiles ${FUNQUAIL_ROOT_PATH}/data/static # Activating WebSockets ProxyPass ${funquail-api-ws}/api/v1/activity # Setting appropriate access levels to serve frontend Options FollowSymLinks AllowOverride None Require all granted Options FollowSymLinks AllowOverride None Require all granted Options FollowSymLinks AllowOverride None Require all granted # XSendFile is serving audio files # WARNING : permissions on paths specified below overrides previous definition, # everything under those paths is potentially exposed. # Following directive may be needed to ensure xsendfile is loaded #LoadModule xsendfile_module modules/mod_xsendfile.so XSendFile On XSendFilePath ${MEDIA_DIRECTORY_PATH} XSendFilePath ${MUSIC_DIRECTORY_PATH} SetEnv MOD_X_SENDFILE_ENABLED 1