Headphones 502 Bad Gateway Error


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 { # GitHub - rembo10/headphones: Automatic music downloader for SABnzbd

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 from your Caddy host?

1 Like

The output is below, I tried curl with and localhost and got 2 different results. Any idea why? When I try in the web browser 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
curl: (7) Failed to connect to 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 to allow outside connections. Once I changed it to 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.