Hi,
I'm hoping that someone can give me a hand with this. I am loving Traefik 2.0 but I cannot for the life of me get it working with Gitea. If anyone could lend me a helping hand it would be much appreciated. Without the load balancer configuration Traefik binds to port 22 as Gitea also exposes an SSH server.
My configuration is as follows:
version: "3"
services:
reverse-proxy:
image: traefik:v2.0
container_name: traefik
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./user_auth:/user_auth
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`traefik.dev.net`)"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.entrypoints=web"
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
gitea:
image: gitea/gitea:latest
environment:
- USER_UID=1000
- USER_GID=1000
- RUN_MODE=dev
labels:
- "traefik.enable=true"
- "traefik.http.routers.gitea.rule=Host(`git.dev.net`)"
- "traefik.http.routers.gitea.entrypoints=web"
- "traefik.http.routers.gitea.service=gitea-service"
- "traefik.http.routers.gitea-secure.rule=Host(`git.dev.net`)"
- "traefik.http.routers.gitea-secure.entrypoints=websecure"
- "traefik.http.routers.gitea-secure.service=gitea-service"
- "traefik.http.services.gitea-service.loadbalancer.server.port=3000"
- "traefik.http.services.gitea-service.loadbalancer.server.scheme=http"
I can access Gitea over http with "git.dev.net" however, when I access it over HTTPS I get a 404 error from Traefik.
The error message that comes up in the Traefik logs are this but I can't make any sense of them:
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Configuration received from provider docker: {\"http\":{\"routers\":{\"api\":{\"entryPoints\":[\"web\"],\"service\":\"api@internal\",\"rule\":\"Host(`traefik.dev.net`)\"},\"gitea\":{\"entryPoints\":[\"web\"],\"service\":\"gitea-service\",\"rule\":\"Host(`git.dev.net`)\"},\"gitea-secure\":{\"entryPoints\":[\"websecure\"],\"service\":\"gitea-service\",\"rule\":\"Host(`git.dev.net`)\"}},\"middlewares\":{\"https-redirect\":{\"redirectScheme\":{\"scheme\":\"https\"}}},\"services\":{\"gitea-service\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://192.168.128.3:3000\"}],\"passHostHeader\":true}},\"reverse-proxy_traefik-tests\":{\"loadBalancer\":{\"servers\":[{\"url\":\"http://192.168.128.2:80\"}],\"passHostHeader\":true}}}},\"tcp\":{}}" providerName=docker
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Added outgoing tracing middleware api@internal" middlewareName=tracing middlewareType=TracingForwarder entryPointName=web routerName=api@docker
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Creating middleware" serviceName=gitea-service entryPointName=web routerName=gitea@docker middlewareName=pipelining middlewareType=Pipelining
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Creating load-balancer" serviceName=gitea-service entryPointName=web routerName=gitea@docker
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Creating server 0 http://192.168.128.3:3000" serverName=0 routerName=gitea@docker serviceName=gitea-service entryPointName=web
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Added outgoing tracing middleware gitea-service" entryPointName=web routerName=gitea@docker middlewareName=tracing middlewareType=TracingForwarder
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Creating middleware" middlewareName=traefik-internal-recovery middlewareType=Recovery entryPointName=web
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Creating middleware" middlewareName=pipelining middlewareType=Pipelining entryPointName=websecure routerName=gitea-secure@docker serviceName=gitea-service
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Creating load-balancer" entryPointName=websecure routerName=gitea-secure@docker serviceName=gitea-service
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Creating server 0 http://192.168.128.3:3000" entryPointName=websecure routerName=gitea-secure@docker serviceName=gitea-service serverName=0
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Added outgoing tracing middleware gitea-service" middlewareType=TracingForwarder routerName=gitea-secure@docker entryPointName=websecure middlewareName=tracing
traefik | time="2019-09-28T16:47:46Z" level=debug msg="Creating middleware" middlewareName=traefik-internal-recovery middlewareType=Recovery entryPointName=websecure
traefik | time="2019-09-28T16:47:46Z" level=debug msg="No default certificate, generating one"
traefik | time="2019-09-28T16:47:53Z" level=debug msg="Serving default certificate for request: \"git.dev.net\""
traefik | time="2019-09-28T16:47:53Z" level=debug msg="http: TLS handshake error from 192.168.128.1:39340: remote error: tls: bad certificate"
traefik | time="2019-09-28T16:48:43Z" level=debug msg="Serving default certificate for request: \"git.dev.net\""