Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plex returns 502 Bad Gateway through Traefik #71

Open
Permanently opened this issue Jan 12, 2025 · 6 comments
Open

Plex returns 502 Bad Gateway through Traefik #71

Permanently opened this issue Jan 12, 2025 · 6 comments

Comments

@Permanently
Copy link

Permanently commented Jan 12, 2025

When accessing Plex, it seems to pop out a 502 error. I tried figuring out where it came from, and my only hypothesis is that the plex hostname can't be reached from Traefik, hence the error to begin with.
Tabby_IytDhSLykg
Not managed to get it working once whilst using this, unfortunately. Not that Plex doesn't work (operates fine through direct IP), just that Traefik doesn't like the plex hostname for whatever reason.

@Permanently Permanently changed the title Plex returns 502 Bad Gateway Plex returns 502 Bad Gateway through Traefik Jan 12, 2025
@tblaudez
Copy link

tblaudez commented Jan 13, 2025

Did you activate the VPN option for Plex in your config.yaml file ?
If so, the host would not be plex:32400 but gluetun:32400

On another note, can you try to access http://plex:32400/web/index.html instead of the webroot ?

@Permanently
Copy link
Author

VPN is not activated — in fact, it's still nearly the default configuration.

  - name: plex
    enabled: true
    vpn: false
    # uncomment to use custom file with specific parameters for hardware transcoding
    #customFile: plex-hardware-transcoding.yaml
    # You can also place you own file in services/custom/ and call it here like this:
    # customFile: custom/my_own_file.yaml
    traefik:
      enabled: true
      rules:
        - host: plex.${TRAEFIK_DOMAIN}
          httpAuth: false
          internalPort: 32400

Whether I try webroot or not is out of the question, as it's a bad address, so it'll fail either way. Regardless, I'll try for your satisfaction.
Tabby_xbTtClyKcX

@tblaudez
Copy link

Maybe, for some reason, your traefik container and plex container are not in the same docker network (traefik-network).
Can you check that ?

@Permanently
Copy link
Author

Plex is on host, whilst Traefik is on traefik-network. However, this is intended.

network_mode: host

The point of this issue is, it's not reachable via hostname, whilst in the Traefik configuration the plex configuration is pointed at via hostname.

@jfroment
Copy link
Owner

Hello!
In fact for a certain time Plex through Traefik does not work, I also have a 502 bad gateway.
It used to work, but I cannot remember since when it's been broken.

The "official" Plex way of accessing it it directly through port 32400 (and via opening port on your router if required).
Do you confirm it works by accessing the machine on port 32400 ? Or via app.plex.tv ?

@Permanently
Copy link
Author

Works through port 32400, and through app.plex.tv. Just, ideally it'd work through plex.${TRAEFIK_DOMAIN} as well. More of a satisfaction thing rather than a necessary requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants