Airsonic with reverse proxy

How can I set up a reverse proxy to reach Airsonic via port 443 and letsencryt certificate via the internet.
As webserver I use lighttpd.
Webserver was installed with nextcloud via the standard script. Also ssl certificate and Airsonic.
Please give me some tips!

You might want to read the Lighttpd mod_proxy documentation about how to proxy a certain “url” to any other host:port:
On the same machine it would be<airsonic_port> then.

About HTTPS you have two possibilities:

  • I would recommend, to keep it easy, to internally map the HTTPS request to Lighttpd to HTTP on Airsonic. There is this “https-remap” setting that allows to do that in both directions (HTTP => HTTPS backwards for Airsonic answers). But to be true I never tested it.
  • Another possibility is to setup Airsonic with HTTPS as well, although it requires either an own HTTPS certificate then or access permissions to the ones, used by Lighttpd as well. But you need to check Airsonic docs then about how to set it up with HTTPS.

Did you manage to get this going?

jason_a69 I tried out Airsonic (and gave up on it because it used way too much memory for my tastes).

If you haven’t already checked it out, I would recommend looking into caddyserver as a reverse proxy. It’s easier to configure and its automatic SSL functionality is pretty slick. Only catch is sometimes you have to change the ports in other things that may be trying to listen in on ports 80 and 443.

Should you go down that route, there were two ways to go:

  1. Use the default config of the airsonic service with the path of /airsonic.
  2. Remove the path argument from the airsonic service (the -Dserver.context-path=/airsonic portion).

Option 1 was a stumper for me because I followed their config for caddy to the point (except for the conf file [virtual host] since I just use a singular Caddyfile) but it was wrong in a couple ways given the dietpi setup config. Going to : won’t work because it’s set to /airsonic. If I put the proxy to /airsonic, I got an error about too many redirects.

I fixed that by using the following entry for my Caddyfile: {
	proxy / <hostip>:<listeningport>/airsonic {
			without /airsonic

If you’re not going to host any other websites, you can remove the path argument so that it’s listening on just :. That simplifies the entry in the Caddyfile a little bit: {
	proxy / <hostip>:<listeningport> {

Hi Dan,

Thanks very much for this.

I also gave up on Airsonic because it was killing my Odroid C2 with its resource requirements.

I will keep this solution in mind if I go back to it.