Skip to content
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

Apache config requires X-Forwarded-Proto RequestHeader #34

Open
eharris opened this issue May 20, 2019 · 1 comment
Open

Apache config requires X-Forwarded-Proto RequestHeader #34

eharris opened this issue May 20, 2019 · 1 comment
Assignees

Comments

@eharris
Copy link

eharris commented May 20, 2019

This is mainly a request for clarification of the documentation at https://airsonic.github.io/docs/proxy/apache/

Problem description

The documentation page linked above gives an example configuration that includes the directive to set X-Forwarded-Proto, but towards the end of the page there is a section that says "NOTE: you could only add ProxyPass and ProxyPassReverse lines to your existing configuration:". That note doesn't mention the RequestHeader directive, but it seems to be required for the web player to work properly. Or perhaps it is a side effect of requiring https?

I'm pretty sure that my configuration used to work fine with just the ProxyPass and ProxyPassReverse directives, but I recently noticed that the web player wasn't working anymore, and after digging into it, discovered that the links for the web player weren't getting rewritten correctly without also having the RequestHeader set X-Forwarded-Proto "https" directive in the Apache config. Perhaps something has changed in Apache that now requires this, and I didn't notice this being broken since I don't normally use the web player interface?

Before opening this I also found issue airsonic/airsonic#594 that has a lot of information about this issue, so I figured it was worth mentioning here. Maybe that issue should even be linked to from that doc page?

Steps to reproduce

Use the given proxy config on an SSL/https only site using Apache proxy without RequestHeader set X-Forwarded-Proto "https":

ProxyPass         /airsonic http://127.0.0.1:8080/airsonic
ProxyPassReverse  /airsonic http://127.0.0.1:8080/airsonic

Attempts to play media files using the web-player will fail with connection errors referencing http://127.0.0.1:8080/airsonic:

GET http://127.0.0.1:8080/airsonic/stream?player=1&id=166539 net::ERR_CONNECTION_REFUSED
GET http://127.0.0.1:8080/airsonic/coverArt.view?size=60&id=166536 net::ERR_CONNECTION_REFUSED

System information

  • Airsonic 10.1.x, 10.2.x
  • Debian stretch with Apache and Tomcat
  • Integrated Apache Proxy config
  • Chrome, Firefox
@eharris eharris self-assigned this Aug 27, 2019
@eharris eharris transferred this issue from airsonic/airsonic Oct 2, 2019
@airsonic airsonic deleted a comment from stale bot Oct 3, 2019
@fxthomas
Copy link
Contributor

I don't use Apache, but it does sound like a mistake as the RequestHeader statement is present in the complete configuration block.

Since I was reorganizing things a bit in airsonic/airsonic-docs#89 when I noticed your issue, let's take care of this now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants