Caddy to reverse proxy to 2 applications

Hi
Totally new to Caddy, just after a bit of advise
I have been using Caddy to reverse proxy to my Jellyfin Server so I can access it remotely. This has been working well.

This is my simple caddyfile

MyDomain {
encode gzip
reverse_proxy localhost:8096
}

I would also like to remote access my NextPVR server and thought I might be able to do both with the same caddyfile

I tried this, thinking if I included the port I could access both applications. Jellyfin still works without having to type the port in the url but NextPVR returns “this site can’t be reached”

I then tried this

MyDomain:8096 {
encode gzip
reverse_proxy localhost:8096
}
MyDomain:8866 {
encode gzip
reverse_proxy localhost:8866
}

This actually stops my Jellyfin server from starting

I have Caddy, Jellyfin and NextPVR all on the same PC, is this good practice of should I have caddy on a separate PC?

Thanks

Without you properly filling out the form with all the details, there are too many moving parts here that could be affecting what you’re doing.

So, I’m just going to make an assumption that your NextPVR is listening on all interfaces on port 8866, which prevents Caddy from listening on the same port.

Change this:

MyDomain:8866 {
    encode gzip
    reverse_proxy localhost:8866
}

to this:

MyDomain:8867 {
    encode gzip
    reverse_proxy localhost:8866
}

and let’s see where that takes you.