I am trying to setup Traefik with a test app on a non-standard port. IIS is currently using port 80 on my machine so I am using port 9000 for my test app. I keep getting back Bad Gateway. The test application is an empty .net core application with a welcome page
From the Bad Gateway response I assume that Traefik is not routing the request correctly or that the container is not picking up the request. I have tried numerous traefik labels and cannot still get the request to oute correctly. I can access the Traefik dashboard on docker.localhost:8080 But if I access my app on webapp3.localhost:9000 I get a "Bad Request"
docker-compose.yml
version: '3.4'
services:
webapp3:
container_name: webapp3
image: ${DOCKER_REGISTRY-}webapp3
build:
context: .
dockerfile: WebApp3/Dockerfile
networks:
- web
labels:
- "traefik.backend=webapp3"
- "traefik.enable=true"
- "traefik.docker.network=web"
- "traefik.frontend.rule=Host:webapp3.localhost"
- "traefik.port=80"
traefik:
container_name: traefik
image: traefik
command: --api --docker --logLevel=DEBUG
restart: always
ports:
- "443:443"
- "9000:80"
- "8080:8080"
volumes:
- ./docker/traefik:/etc/traefik/
- /var/run/docker.sock:/var/run/docker.sock:ro
- /dev/null:/traefik.toml
networks:
- web
labels:
- "traefik.enable=true"
- "traefik.backend=traefik"
- "traefik.frontend.rule=Host:docker.localhost"
- "traefik.port=8080"
- "traefik.docker.network=web"
networks:
web:
external : true
docker-compose.override.yml
version: '3.4'
services:
webapp3:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=https://+:443;http://+:80;http://+:9000
volumes:
- ${APPDATA}/ASP.NET/Https:/root/.aspnet/https:ro
- ${APPDATA}/Microsoft/UserSecrets:/root/.microsoft/usersecrets:ro