Plex behind Caddy redirects to Plex login

So I try to run Plex behind Caddy as a proxy.
Caddy and Plex both run in docker containers.

But when I browse to my Plex subdomain, I got redirect to the Plex login web page, where I just want to see my library without going to

My Caddyfile for Plex:

plex.{$CADDY_DOMAIN} {

   errors stdout

   # Password protect everything

   proxy / plex:32400 {

My docker-compose.yml for Plex:

        image: linuxserver/plex
        container_name: plex
            - VERSION=docker
            - 32400
        restart: unless-stopped

Anybody knows how to fix this?

Hey @DenBeke,

In my experience, reverse proxying Plex is far more trouble than the benefits are worth. Honestly, I just use

It looks like they’ve written their web app to issue redirects to their own site. You could try to use proxy header regex rewriting (see:, which should be available in the latest Caddy release (although currently still undocumented), to alter the Location header it sends and force it to redirect to your own site. No promises that the locally hosted version served by the Plex instance itself even has a login path, though.

1 Like

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