Search code examples
sslreverse-proxycaddyplexcaddyfile

Caddy + Organizr + Plex Media Server = Can't connect to PMS?


Ultimately my goal is to be able to load my PMS admin interface via Organizr. I had already tried simply using the URL https://app.plex.tv/desktop through Organizr, but that URL disallows loading the page in iFrames, so now I'm trying to use Caddy server to reverse proxy it to my local LAN IP instead ...

I have this code in my Caddyfile (note that my PMS is hosted on a different pc on my LAN):

proxy /pms https://192.168.234.234:32400 {
  websocket
  keepalive 12
  header_upstream Host {host}
  header_upstream X-Real-IP {remote}
  header_upstream X-Forwarded-For {remote}
  header_upstream X-Forwarded-Proto {scheme}
  transparent
}

Then when I try to visit the URL, it gives me a 502 Bad Gateway, and the Caddy log file says [ERROR 502 /pms] x509: cannot validate certificate for 192.168.234.234 because it doesn't contain any IP SANs

If I add the insecure_skip_verify directive, I get the error: 401 Unauthorized instead.

I'm still pretty new to using Caddy, anyone know what's going on here?


Solution

  • To solve my particular problem; in Organizer I used the Plex web URL instead.

    https://192.168.234.234:32400/web

    Note the /web at the end.

    Another option, was to have Organizr open it using the PopOut option, which just acts something like a regular bookmark, and loads any URL in a new tab, and/or add a line to the Caddyfile like this:

    redir /pms https://app.plex.tv/desktop 301

    Then in Organizr you could use either the /pms URL, or the direct Plex URL https://app.plex.tv/desktop, and it'd just load Plex in a new tab.