I struggle to properly redirect traffic from outside my network to Subsonic when using https. In my network, there is a web server (apache 2.4 with IP 192.168.1.10) that takes all http and https traffic from outside my local network. It is suppose to dispatch the traffic to all other web servers, such has the one which hosts Subsonic, everything works fine but Subsonic.
Here the virtualhost that I use on the web server that redirect all traffic:
- Code: Select all
<VirtualHost 192.168.1.10:443>
ServerAdmin <myemail>
ServerName subsonic.forumanalogue.fr
ErrorLog /var/log/apache2/subsonic-error.log
LogLevel debug
CustomLog /var/log/apache2/subsonic-access.log combined
SSLEngine On
SSLCertificateFile <certfile>
SSLCertificateKeyFile <keyfile>
SSLCertificateChainFile <chainfile>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
RewriteRule .* - [F]
</IfModule>
<IfModule mod_rewrite.c>
<IfModule mod_proxy.c>
SSLProxyEngine On
SSLProxyCheckPeerExpire On
SSLProxyVerifyDepth 10
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / https://subsonic.forumanalogue.fr:443/ keepalive=On retry=5
ProxyPassReverse / https://subsonic.forumanalogue.fr:443/
RewriteRule ^/(.*) https://subsonic.forumanalogue.fr/$1 [P,L]
</IfModule>
</IfModule>
<Location />
Order deny,allow
Allow from all
</Location>
</VirtualHost>
<VirtualHost 192.168.1.10:80>
ServerName subsonic.forumanalogue.fr
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301]
Redirect permanent / https://subsonic.forumanalogue.fr/
</VirtualHost>
It is from a generic template that I use all the time for my other redirections.
When I try to connect, Chromium browser says "subsonic.forumanalogue.fr redirected you too many times.". Here what I get in the logs on the web server at 192.168.1.10
- Code: Select all
[Wed May 25 12:58:27.736475 2016] [proxy:debug] [pid 19802] proxy_util.c(1694): AH00925: initializing worker https://subsonic.forumanalogue.fr/ shared
[Wed May 25 12:58:27.736525 2016] [proxy:debug] [pid 19802] proxy_util.c(1734): AH00927: initializing worker https://subsonic.forumanalogue.fr/ local
[Wed May 25 12:58:27.736565 2016] [proxy:debug] [pid 19802] proxy_util.c(1785): AH00931: initialized single connection worker in child 19802 for (subsonic.forumanalogue.fr)
and nothing in subsonic logs on the other server.
Notice that it works fine on local network, i.e. if I access directly to subsonic server, or if I redirect from internet for http only.
