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

Ampache, Caddy Proxy and SubsonicAPI-based App don't work #128

Open
chilcano opened this issue Sep 16, 2024 · 1 comment
Open

Ampache, Caddy Proxy and SubsonicAPI-based App don't work #128

chilcano opened this issue Sep 16, 2024 · 1 comment

Comments

@chilcano
Copy link

Hi there.
I've deployed ampache and caddy using docker compose successfully.
Ampache works from its Web UI, however It doesn't work when trying to play/stream through any Subsonic API-based Android App. I only can browse songs, albums, etc.

My config is:

  1. Ampache Docker Compose: I've used the same docker-compose.yml available in this repo.
  2. Caddyfile
{
  http_port 8080
  https_port 8443

  log {
    output file /logs/caddy.log
  }
}

*.my-fqdn:8443 {
  log
  tls {
    dns duckdns {env.DNS_PROVIDER_TOKEN}
  }

  @ampache host ampache.my-fqdn
  handle @ampache {
    reverse_proxy ampache:80
  }
}
  1. SubsonicAPI app tested:
  • Substream - I can browse songs but I can not play/stream. Not error.
  • Ultrasonic - I can browse songs but I can not play/stream because when clicking in play, It stands in "buffering" and doesn't stop.

ultrasonic-buffering

I've tried next changes without success:

  1. Update the Caddyfile:
{
  http_port 8080
  https_port 8443

  log {
    output file /logs/caddy.log
  }
}

*.my-fqdn:8443 {
  log
  tls {
    dns duckdns {env.DNS_PROVIDER_TOKEN}
  }

  @ampache host ampache.my-fqdn
  handle @ampache {
    # Rewrite rules for Subsonic backend
    @rest path_regexp rest ^/rest/(.*).view$
    rewrite @rest /rest/index.php?action={re.rest.1}
    @rest-fake path_regexp rest-fake ^/rest/fake/(.+)$
    rewrite @rest-fake /play/{re.rest-fake.1}
    # Rewrite rule for Channels
    @channel path_regexp channel ^/channel/([0-9]+)/(.*)$
    rewrite @channel /channel/index.php?channel={re.channel.1}&target={re.channel.2}
    reverse_proxy ampache:80
  }
}
  1. Change the Ampache configuration using Ampache Web UI:
  • Preferences > Options > Subsonic > Force Subsonic streams to download from Off to On.
  • Preferences > Streaming > Enable URL Rewriting from Off to On.
  • Preferences > Streaming > Use an alternative playback action for streaming if you have issues with playing music from Off to On.

Also I've added my existing Navidrome proxied by the same Caddy Proxy to Ultrasonic app, I've disabled Jukebox by Default in Ultrasonic configuration and Ultrasonic app has worked smoothly.

I don't know what else to try. I appreciate your support and ideas on this.

Regards.

@chilcano
Copy link
Author

Changing from local_web_path="https://ampache.my-fqdn:80" to local_web_path="http://localhost" in ampache/config/ampache.cfg.php fixed the problem. Once changed I restarted the Ampache service running in docker: docker compose restart ampache

You can see the current value of local_web_path through WebUI > Admin > Server Config > Ampache Debug.

The ampache.cfg.php includes information about running it behind of proxy and here as well:
https://github.com/ampache/ampache-docker?tab=readme-ov-file#set-the-local_web_path

Hope this helps.

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

1 participant