Proxy works for root of domain

(Read this, then delete it before you post.) To get the best help possible, please:

  • explain what you are trying to do,
    I am trying to consolidate my outside presence by using Caddy as a front end proxy to the WAN/. For example my plex server which runs on port 32400 on the localhost. I tried this in my caddyfile:

    proxy /plex localhost:32400 {

But it gives me a 401 Unauthorized.

If I change the /plex to be / it will work perfectly. Any thoughts? I’m also trying to do the same with my home cameras which would be /cam1 and /cam2 but they give the same 401 Unauthorized errors unless they are the root.

Thanks again for any help!

Is plex expecting the path to have /plex in it? If not, use without /plex to strip it.

Thank’s for your help Matt. The link that is accessible (without a proxy) is http://localhost:32400/web/index.html

If localhost:32400 is visited it will redirect to /web/index.html which it does it i visit (proxy the root folder / ) but if I do a proxy for it gives me the 401 error.

Plex is a bit of a problem when it comes to reverse proxying, exponentially so when it comes to subfolders instead of subdomains. I cannot recommend enough just putting it on a subdomain instead. It wants /web, /system, /servers, /accounts, /myplex, /photo, and /clients, as far as I’m aware.

That said, here is a very pertinent guide which covers using nginx for this purpose, the approach should be the same for Caddy with some config reverse engineering.

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