Hi at all!
In my OMV, I installed Nextcloud (following the macom guide - [How-To] Nextcloud with Letsencrypt using OMV and docker-compose) and Airsonic.
Airsonic however does not use Letsencrypt, so I tried to change its configuration.
First of all, I removed LetsEncrypt service from the Nextcloud stack and created a container only for it.
I added LetsEncrypt container network the to the containers of the Nextcloud stack (redis, nextcloud and nextcloudDB).
Nextcloud continues to work properly.
So, I tried to follow the same steps to insert LetsEncrypt on Airsonic.
- I removed 4040 port forwarding from the router, leaving only ports 80 and 443 rules.
- I modified the Airsonic stack by inserting the variables CONTEXT_PATH and JAVA_OPTS and remove port 4040
---
version: "2.1"
services:
airsonic:
image: linuxserver/airsonic
container_name: airsonic
environment:
- PUID=998
- PGID=100
- TZ=Europe/Rome
- CONTEXT_PATH=/airsonic
- JAVA_OPTS=-Dserver.use-forward-headers=true
volumes:
- /srv/app/config/airsonic:/config
- /srv/dev-mydisk/music:/music
- /srv/dev-mydisk/playlists:/playlists
- /srv/dev-mydisk/podcasts:/podcasts
- /srv/dev-mydisk/other_media:/media
- /srv/dev-mydisk/private:/private
restart: unless-stopped
Alles anzeigen
- I removed from airsonic container the bridge network and added the LetsEncrypt network
I then moved on to setting up the proxy:
cd /srv/dev-mydisk/appdata/letsencrypt/nginx/proxy-confs
cp airsonic.subfolder.conf.sample airsonic.subfolder.conf
and I modified the .conf file in this way:
# set the CONTEXT_PATH variable to /airsonic in airsonic container.
location ^~ /airsonic/ {
# enable the next two lines for http auth
#auth_basic "Restricted";
#auth_basic_user_file /config/nginx/.htpasswd;
# enable the next two lines for ldap auth, also customize and enable ldap.conf in the default conf
#auth_request /auth;
#error_page 401 =200 /ldaplogin;
# enable for Authelia, also enable authelia-server.conf in the default site config
#include /config/nginx/authelia-location.conf;
include /config/nginx/proxy.conf;
resolver 127.0.0.11 valid=30s;
set $upstream_app airsonic;
set $upstream_port 443;
set $upstream_proto https;
proxy_pass $upstream_proto://$upstream_app:$upstream_port;
rewrite /airsonic(.*) $1 break;
}
Alles anzeigen
Now, if I call:
- https://mydomain.com/airsonic/ I am redirected to Nextcloud (https://mydomain.com/nextcloud/) or get a 502 error (Bad Gateway)
- https://mydomain.com/airsonic/login I get a 502 error (Bad Gateway)
Someone can help me?
Thanks!