Caddy is passing the IP of VPS and not the remote client to home server

1. The problem I’m having:

I have a Caddyfile on my VPS that uses reverse proxy for a Plex server that I use and works, however if a Plex client joins, the Plex server always shows the IP of the VPS (Tailscale VPS node) and not the remote ip of the client. I checked the Caddy logs on the VPS and the remote IP is correct for the client. Is that somehow that Caddy is passing the incorrect address on the headers ? Or do I have to add extra headers and use that parameter ?

2. Error messages and/or full log output:

NA

3. Caddy version:

4. How I installed and ran Caddy:

a. System environment:

b. Command:

NA

c. Service/unit/compose file:

NA

d. My complete Caddy config:

the Plex subdomain/domain is registered at Cloudflare and is being proxied.

plex.domain.tld:port {
   reverse_proxy https://docker_tailscale_plexdirect_ipv4:port
}

5. Links to relevant resources:

This is a Plex issue, not a Caddy issue. Plex should honor the headers X-Forwarded-For and X-Real-IP, which Caddy sets automaticly. From a quick Google search, it appears that Plex only honors the headers if the connection comes from the private IP address ranges.

Thank you, this also explains another issue where plex considered remote traffic via caddy to be considered as local traffic and I had to set CIDR specific rules to enforce remote bandwidth restrictions.

I think Jellyfin correctly honors those headers in my early testing.

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