A reverse proxy is a public-facing web server sitting in front of an internal server such as Airsonic. The Airsonic server never communicates with the outside ; instead, the reverse proxy handles all HTTP(S) requests and forwards them to Airsonic.
This is useful in many ways, such as gathering all web configuration in the same place. It also handles some options (HTTPS) much better than the bundled Airsonic server or a servlet container such as Tomcat.
This guide assumes you already have a working Airsonic installation after following the installation guide.
This guide assumes you already have a TLS certificate. Let’s Encrypt currently provides such certificates for free using the certbot software.
A few settings should be tweaked via Spring Boot or Tomcat configuration:
/airsonic
, the default value is /
)127.0.0.1
)8080
)To change this, please use one of the guide below according to your installation:
You will also need to make sure Airsonic uses the correct headers for redirects, by setting the server.use-forward-headers
property to true
.
To do so, stop your Airsonic server or Docker image, then edit the config/application.properties
file:
nano /path/to/airsonic/config/application.properties
Add the following line to the bottom of the file:
server.use-forward-headers=true
Use Ctrl+X to save and exit the file, and restart your Airsonic server or Docker image.
Airsonic expects proxies to provide information about their incoming URL so that Airsonic can craft it when needed. To do so, Airsonic looks for the following HTTP headers:
X-Forwarded-Host
X-Forwarded-Proto
X-Forwarded-Server
X-Forwarded-Host
is not availableCurrently this is used wherever, NetworkService#getBaseUrl
is called. A couple notable places include:
Use a guide in the list below: