Reverse Proxy Subsonic with Apache
Category : How-to
Subsonic is a web-based media player for playing audio and video files through a web browser. You can reverse proxy Subsonic using Apache
See my blog post on using Apache as a reverse proxy for more detailed information on Apache configuration files.
The below configuration expects the backend Subsonic port to be non-ssl as the encryption will be offloaded to the Apache reverse proxy server. The reverse proxy URL will be encrypted and available on the default SSL port 443. This has the advantage of not using any CPU on the Subsonic server for encrypting traffic allowing it to concentrate on transcoding.
Add the below text to a new sites-available Apache configuration file.
vi /etc/apache2/sites-available/subsonic
<VirtualHost *:443> SSLEngine On SSLCertificateFile /ssl-certs/cert.cer SSLCertificateKeyFile /ssl-certs/key.key SSLProxyEngine on ServerAdmin [email protected] DocumentRoot /var/www ServerName subsonic.jamescoyle.net # Possible values include: debug, info, notice, warn, error, crit ,alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/subsonic-access.log combined ErrorLog ${APACHE_LOG_DIR}/subsonic-error.logProxyHTMLStripComments on <Location /> ProxyRequests off RequestHeader unset Accept-Encoding ProxyPass http://192.168.1.22:4040/ ProxyPassReverse http://192.168.1.22:4040/ Order allow,deny Allow from all </Location> <VirtualHost>
Enable the new site in Apache and reload the configuration.
a2ensite subsonic
service apache2 reload
4 Comments
Jadon Smith
15-May-2015 at 12:44 amhttp://www.jamescoyle.net/how-to/875-reverse-proxy-subsonic-with-apache
There is a small mistake in this post.
SSLEngine On
SSLCertificateFile /ssl-certs/cert.cer
SSLCertificateKeyFile /ssl-certs/key.key
SSLProxyEngine onServerAdmin [email protected]
DocumentRoot /var/www
should be
SSLEngine On
SSLCertificateFile /ssl-certs/cert.cer
SSLCertificateKeyFile /ssl-certs/key.key
SSLProxyEngine on
ServerAdmin [email protected]
DocumentRoot /var/www
james.coyle
27-May-2015 at 10:04 pmCorrected, thanks.
Mike
27-Dec-2015 at 10:45 pmNice article! Just out of curiosity, wouldn’t the CPU be used by Apache in order to encrypt the traffic? If so, wouldn’t the overall use of the CPU remain the same or is Apache more efficient than Subsonic? Interesting article and idea none the less. Thanks.
PL Vallee
26-Aug-2022 at 6:03 pmDon’t work for me.
I get this error when I place the order: a2ensite subsonic
ERROR: Site subsonic does not exist!