Configure Subsonic to be behind an Apache 2.4 proxy
Posted: Fri Sep 26, 2014 5:47 pm
Since version 5, I went on a particular problem with my current setup of my Apache2 proxy. When I was trying to play videos, Subsonic would use a local URL instead of my domain name and wouldn't use the HTTPS protocol. To fix this problem, we need to change two particular settings in order to make it work correctly again.
First of all, open your Subsonic Virtual Host configuration on the server hosting Apache2. In your proxy configuration section, please add these lines:
These lines tells Apache2 to ignore the SSL validation of Subsonic (which is invalid by default). Additionally it will preserve the host information, so that subsonic won't use the local URL while using the video player.
The second thing you need to do is to enable HTTPS on subsonic. To do that, open the configuration file on your system, then replace the SUBSONIC_ARGS line with something like this:
Make SURE to set the "port" argument if you use 4040 for HTTPS.
In your Apache2 proxy setting, make sure the local HTTPS URL is used.
Example:
If you guys want a well explained tutorial of how to make a complete configuration, I will make it if people ask for it. I hope this helps for the other!
Dave
EDIT: Since someone mentioned it, some configuration of Apache only work with version 2.4.5 or later.
First of all, open your Subsonic Virtual Host configuration on the server hosting Apache2. In your proxy configuration section, please add these lines:
- Code: Select all
ProxyRequests Off
ProxyPreserveHost on
SSLProxyEngine On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerExpire off
SSLProxyCheckPeerName off
These lines tells Apache2 to ignore the SSL validation of Subsonic (which is invalid by default). Additionally it will preserve the host information, so that subsonic won't use the local URL while using the video player.
The second thing you need to do is to enable HTTPS on subsonic. To do that, open the configuration file on your system, then replace the SUBSONIC_ARGS line with something like this:
- Code: Select all
SUBSONIC_ARGS="--max-memory=512 --port=4041 --https-port=4040"
Make SURE to set the "port" argument if you use 4040 for HTTPS.
In your Apache2 proxy setting, make sure the local HTTPS URL is used.
Example:
- Code: Select all
ProxyPass / https://mylocalhostname:4040/
ProxyPassReverse / https://mylocalhostname:4040/
If you guys want a well explained tutorial of how to make a complete configuration, I will make it if people ask for it. I hope this helps for the other!
Dave
EDIT: Since someone mentioned it, some configuration of Apache only work with version 2.4.5 or later.