Hello. I'm trying to setup a reverse proxy for plex. I currently do not have any config files. Everything is currently done in docker-compose.yaml.
If I need to switch to using config files, which I think I've seen a reference to in my searching, how does it know how to read those? Does it just look at all yml files in /config?
I can see the reverse proxy for plex getting setup, the cert gets created, but when I try to connect it doesn't work. I don't think the reverse proxy knows how to connect to the internal server. You can see in my yaml file that I've tried a few different things.
How do I get the reverse proxy to connect to an internal resource?
If I need to use config yml files, how would I convert my existing docker-compse.yaml and what would I need to get this redirect working?
Any help is appreciated.
Thanks!
version: "3.9"
services:
traefik:
image: "traefik:v3.0"
container_name: traefik
hostname: traefik
command:
# - --log.level=DEBUG
- --api.dashboard=true
- --api.insecure=true
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --providers.docker
- --providers.docker.exposedByDefault=false
- --api
- --certificatesresolvers.le.acme.email=myuser@mydomain.com
- --certificatesresolvers.le.acme.storage=./acme.json
- --certificatesresolvers.le.acme.tlschallenge=true
ports:
- "80:80"
- "443:443"
- "8880:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./acme.json:/acme.json"
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
# Dashboard
- "traefik.http.routers.traefik.rule=Host(`traefik-dashboard.mydomain.com`)"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.tls=true"
- "traefik.http.routers.traefik.tls.certresolver=le"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.entrypoints=web"
- "traefik.http.routers.traefik.middlewares=authtraefik"
- "traefik.http.middlewares.authtraefik.basicauth.users=myuser:password"
# Plex
- "traefik.http.routers.plex.rule=Host(`plex.mydomain.com`)"
- "traefik.http.routers.plex.entrypoints=websecure"
- "traefik.http.routers.plex.tls=true"
- "traefik.http.routers.plex.tls.certresolver=le"
# - "traefik.http.services.plex.loadbalancer.server.scheme=https"
- "traefik.http.services.plex.loadbalancer.server.url=https://192.168.0.144:32400"
# - "traefik.http.services.plex.loadbalancer.server.ip=192.168.0.144"
# - "traefik.http.services.plex.loadbalancer.server.port=32400"
# global redirect to https
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https"
# middleware redirect
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
restart: unless-stopped
networks:
- proxy
whoami:
# A container that exposes an API to show its IP address
image: traefik/whoami
labels:
- "traefik.http.routers.whoami.rule=Host(`whoami.docker.localhost`)"
ports:
- 8088:80
networks:
- proxy
networks:
proxy:
external: true
name: proxy