Reverse proxy with path matchers

1. Caddy version (caddy version):

2.3.0

2. How I run Caddy:

From PowerShell?

a. System environment:

Windows 10

b. Command:

.\caddy_windows_amd64.exe start

c. Service/unit/compose file:

NA

d. My complete Caddyfile or JSON config:

localhost {
    handle_path /qbittorrent {
        reverse_proxy http://192.168.123.30:8008
    }
    handle_path /jellyfin {
        reverse_proxy http://192.168.123.30:8096
    }
}

3. The problem I’m having:

Want to reverse proxy qBittorrent WebUI and Jellyfin. Everything works as intended with Caddyfile:

localhost {
    handle {
        reverse_proxy http://192.168.123.30:8008
    }
}

or

localhost {
    handle {
        reverse_proxy http://192.168.123.30:8096
    }
}

However, if path matchers are added, qBittorrent shows WebUI with no content and Jellyfin goes completely blank.

4. Error messages and/or full log output:

https://paste.ubuntu.com/p/9pZrny4Sss/

5. What I already tried:

NA

6. Links to relevant resources:

NA

Path matching in Caddy is exact, so /qbittorrent will only match exactly /qbittorrent. What you need is to add a * at the end to match every other subpath, i.e. /qbittorrent*.

That said, be aware that you may run into issues when proxying to apps using subpaths. See the below article for an explanation. Generally, I recommend using subdomains for each service instead.

1 Like

Thank you for your information!

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.