Hi Community,
I'm trying to get into traefik world and im about to setup a simple use case a la hello world:
(Browser) <-- internet --> [(sub.domain.com/mongo:Traefik_host_withdocker): traefik-> Nginx ]
I am starting/configuring traefik via CLI & I am not using swarmMode:
here is how I do start my traefik container:
# create docker network for traefik and containers:
docker network create traefik-network
# start traefik:
docker run --rm --name traefik -it \
-p 80:80 -p 443:443 -p 8080:8080 --network traefik-network \
--label="traefik.http.routers.http-catchall.rule=HostRegexp(\`{host:.+}\`)" \
--label="traefik.http.routers.http-catchall.middlewares=redirect-to-https" \
--label="traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https" \
--label="traefik.http.routers.http-catchall.entrypoints=http" \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
traefik:v2.2.0 \
--api.insecure=true \
--global.checkNewVersion=true \
--log=true \
--log.level=DEBUG \
--accessLog=true \
--providers.docker=true \
--providers.docker.swarmMode=false \
--entryPoints.http.address=:80 \
--entryPoints.https.address=:443 \
--providers.docker.network=traefik-network
# start an Nginx container that is supposed to serve all request that matches its rules:
docker run --name="mongo" --network traefik-network -d \
--label "traefik.enable=true" \
--label "traefik.http.routers.mongo.rule=PathPrefix(\`/mongo\`)" \
--label "traefik.http.middlewares.mongo-stripprefix.stripprefix.prefixes=/mongo" \
--label "traefik.http.routers.mongo.middlewares=mongo-stripprefix" \
--label "traefik.http.routers.mongo.entrypoints=http,https" Nginx
in my traefik Dashbaord I can see that everything looks "Ok" but when I try to access my host: subdomain.mydomain.com/mongo I get an HTTP 502/gateway timeout
I don't know what I am missing and I would be glad if someone can point me to the right direction!
Thanks & Regards
** update: modified the traefik start command to join the docker network ** not i get 404 but not form Nginx as i do monitor its access logs