1. Caddy version (caddy version
):
2. How I run Caddy:
a. System environment:
Ubuntu 20.04 using systemd to run Caddy
b. Command:
I run Caddy through systemctl as installed from “sudo apt install caddy”
sudo systemctl start caddy
c. Service/unit/compose file:
Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.
d. My complete Caddyfile or JSON config:
myDomain.com {
reverse_proxy 127.0.0.1:8096
}
trailers.apple.com:443 {
reverse_proxy 192.168.0.58:4433 {
header_down Host {host}
header_down X-Real-IP {remote}
}
tls /home/alex/PlexConnect/assets/certificates/trailers.pem /home/alex/PlexConnect/assets/certificates/trailers.key
}
trailers.apple.com:80 {
reverse_proxy 192.168.0.58:8090 {
header_down Host {host}
header_down X-Real-IP {remote}
}
}
3. The problem I’m having:
Hi all, I posted about a year ago with this same issue and then gave up on it. Since then I’ve tried to get this to work again, I’ve made a bit of progress and I think my caddyfile is close.
PlexConnect is a service run on my machine that redirects an app from an old Apple TV 3 to a Plex server. That way you can view a Plex library even though apps aren’t available on the Apple TV. However, because I’m running Caddy on this machine already, the standard PlexConnect ports (80/443) aren’t available. I have confirmed that when disabling Caddy that PlexConnect works as intended.
In the PlexConnect settings I’ve changed both ports to prevent the conflict and tried to update my caddyfile to match.
The PlexConnect documentation does feature an nginx config here I used this as a best guess to try and do the same within Caddy.
It seems to work to a degree as I’m able to load the certificates on the Apple TV, so something works. However I’m unable to view anything when opening the intercepted app, Trailers, and instead get a generic error that it’s unavailable at this time. If I have the machines address as 127.0.0.1 instead of the local IP it will fail and not even load certificates. Again, I think I’m on the right track overall but not quite there.
4. Error messages and/or full log output:
5. What I already tried:
Caddy doesn’t give me any issues but I still don’t think the config is correct, I suspect it has to do with how I’ve configured my headers. I’m a bit of a novice here but did my best based on reading the documentation. Again, I suspect the example nginx config will have the answer.
Initially I had the incorrect path for certs and also had to change permissions on one. Now that’s all done and Caddy will start without issue.
I’ve done my best with headers but I’m definitely not an expert. From looking at the caddy documentation it looks like the X-Forwarded-For
and X-Forwarded-Proto
from the nginx config can be ignored as caddy does this automatically.