I'm trying to use traefik to point to the Unifi Controller in Docker Compose.
The following configuration gives me in the browser:
Bad Request
This combination of host and port requires TLS.
version: '3'
services:
traefik:
image: "traefik:v2.0"
container_name: "traefik"
command:
- --log.level=DEBUG
- --api.insecure=true
- --providers.docker
- "--providers.docker.exposedbydefault=false"
- "--serversTransport.insecureSkipVerify=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myhttpchallenge.acme.httpchallenge=true"
- "--certificatesresolvers.myhttpchallenge.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.myhttpchallenge.acme.email=something@gmail.com"
- "--certificatesresolvers.myhttpchallenge.acme.storage=/acme/acme.json"
ports:
- "80:80"
- "443:443"
# - "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/home/ubuntu/acme/:/acme"
networks:
- proxy
unifi:
image: jacobalberty/unifi
container_name: unifi
volumes:
- ~/unifi:/unifi
ports:
- 3478:3478/udp
- 8080:8080
- 8443:8443
- 8843:8843
- 10001:10001/udp
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.unifi-https.tls=true"
- "traefik.http.routers.unifi-https.rule=Host(`unifi.lallier.tech`)"
- "traefik.http.routers.unifi-https.entrypoints=websecure"
- "traefik.http.routers.unifi-https.tls.certresolver=myhttpchallenge"
- "traefik.http.middlewares.my-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.my-redirect.redirectscheme.permanent=true"
- "traefik.http.routers.unifi-https.middlewares=my-redirect"
- "traefik.http.services.my-service.loadbalancer.server.port=8443"
networks:
- proxy
networks:
proxy: