Headphones 502 Bad Gateway Error

Hello,

I setup my media center application (utorent, couchpotato, sickgear, etc.) behind Caddy and all the applications are working properly except for Headphones.

In the Headphones config.ini files in the http_root = /music and am using port 8181.

In my Caddyfile I have the following entry:

proxy /music 127.0.0.1:8181 { # GitHub - rembo10/headphones: Automatic music downloader for SABnzbd
transparent
}

Whenever I type in the browser localhost/music it displays 502 Bad Gateway. I have tried different ports, and restarting Heaphones and Caddy to no avail. Hope someone can assist as this is annoying.

Hi @hunt2714, welcome to the Caddy community.

What’s the output of curl -I 127.0.0.1:8181/music from your Caddy host?

1 Like

The output is below, I tried curl with 127.0.0.1 and localhost and got 2 different results. Any idea why? When I try in the web browser 127.0.0.1:8181/music fails, but localhost:8181/music works.

C:\Users\Ryan>curl -I localhost:8181/music
HTTP/1.1 301 Moved Permanently
Date: Wed, 23 Aug 2017 01:28:13 GMT
Content-Length: 111
Content-Type: text/html;charset=utf-8
Location: http://localhost:8181/music/
Server: CherryPy/3.6.0

C:\Users\Ryan>curl -I 127.0.0.1:8181/music
curl: (7) Failed to connect to 127.0.0.1 port 8181: Connection refused

Whitestrake, your advise to check curl led me to the find the solution. In the settings for Headphones under Http Host it was set to localhost and in the comment below the box it says Use 0.0.0.0 to allow outside connections. Once I changed it to 0.0.0.0 and restarted the application it started working again. It still says HTTP/1.1 301 Moved Permanently, which is odd, but at least now it works.

Thanks for the point in the right direction.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.