Skip to content

Apache config requires X-Forwarded-Proto RequestHeader #34

Description

@eharris

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions