-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirecting all HTTPS URL requests to HTTP #33
Comments
This appears to be the root cause of #28 . The interesting thing is that it only happens sometimes -- most of the links in the tab bar seem to work with an ordinary reverse proxy, only some of them change the link to HTTP. Unfortunately the "Home" link is one of those, so this is probably forcing your first access to http. |
I have semi worked around the issue using a variation on the HTTP proxy I described in my original post. I made the HTTP reverse proxy point to a super basic virtual host that simply redirects any HTTP request back to HTTPS using an .htaccess file. There is an ever so tiny delay when you load pages on booksonic's website as it redirects to https but at least users are doing input into HTTPS pages from now on. My HTTP to HTTPS redirect virtual host is hosted using Apache 2.4; I have no idea if nginx is the same or not. Here is the .htaccess for it: |
For me the SSL communication works as described above model a). as long as I do not call the settings or use the web player. Setting: Webplayer: DS 918+ |
I struggled with this problem too, but found that the Airsonic media server have a setting for this according to their documentation https://airsonic.github.io/docs/proxy/prerequisites/#reverse-proxy-configuration. |
YES! THANK YOU. I was going crazy with nginx trying to use sub_filter to modify the content to change http over to https, I tried all sorts of headers on both the frontend and backend, etc. and I could not get around that Mixed Content error message in Chrome. @Karamba91 's suggestion of changing airsonic.properties and adding 'server.use-forward-headers=true' worked perfectly. Now I can click around all the various links and everything is https, everything works. Thank you. |
Problem description
BookSonic is redirecting all HTTPS requests to HTTP when accessed through an HTTPS reverse proxy.
I'm hosting this using a docker image behind a reverse proxy server. I am trying to keep it secure behind an HTTPS reverse proxy but if I go to the URL using HTTPS, it redirects it to HTTP. I'm using a subdomain that points to my reverse proxy. Lets assume I am using "audiobooks.example.com" as the subdomain. If I go to "https://audiobooks.example.com/", I get redirected to "http://audiobooks.example.com/". I would prefer it stay with https instead of http.
I couldn't get it to work at all until I created a 2nd reverse proxy for the HTTP request. Though now its almost exclusively using http, not https.
Steps to reproduce
This is done on a Synology DS918+ running DSM 6.2.3-25426 Update 3
a. HTTPS proxy:
- Source Protocol: HTTPS
- Source Hostname: audiobooks.example.com
- Source Port: 443
- Source options: Enable HTTP/2
- Destination Protocol: HTTP
- Destination Hostname: localhost
- Destination Port: 9002
b. HTTP proxy:
- Source Protocol: HTTP
- Source Hostname: audiobooks.example.com
- Source Port: 80
- Source options: Enable HTTP/2
- Destination Protocol: HTTP
- Destination Hostname: localhost
- Destination Port: 9002
System information
Booksonic Version: 1.2 - January 11, 2020 (I assume this is what is meant by 'Airsonic'?)
About Booksonic - Server: jetty/9.4.24.v20191120, java 1.8.0_275, Linux (91.8 MB / 118.1 MB)
Operating System: Synology DS918+ running DSM 6.2.3-25426 Update 3
Proxy Server: built-in reverse proxy system of Synology, I believe its nginx based.
Client: Microsoft Edge - Chromium 87.0.664.75
Language: English
Additional notes
I don't necessarily need BookSonic to have its own SSL / HTTPS system built-in, I just don't want it to re-write / re-direct the URL to HTTP if its coming from HTTPS.
The text was updated successfully, but these errors were encountered: