Skip to content

Connecting to a remote Ampache server (CORS)

Mitch Ray edited this page Dec 5, 2024 · 2 revisions

In order to connect to a remote Ampache server, it must accept the following

  • 'Authorization' header: Needed to login via Ampache API SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
  • 'X-Requested-With' header: Set by the Tabulator table library
  • 'Access-Control-Allow-Origin': Wildcard * or explicitly set to your connecting URL

Example Apache config:

Header set Access-Control-Allow-Headers "Authorization, X-Requested-With"
Header set Access-Control-Allow-Origin "*"

May also require additional config if Authorization is not forwarded (indicated by API requests failing but succeeding when visiting directly)

SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
Clone this wiki locally