Hi !
I'm trying to get up my first traefik server.
Https works and the basic configuration works.
Now, I want a tcp redirect but i'm not able to understand how it works.
I'm a little newbie in the network world.
I've tried this :
version: "3.3"
services:
traefik:
image: "traefik"
command:
- --entrypoints.web.address=:80
- --entrypoints.websecure.address=:443
- --entrypoints.autre.address=:8080
- --providers.docker
- --api
- --certificatesresolvers.leresolver.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory
- --certificatesresolvers.leresolver.acme.email=re@re.com
- --certificatesresolvers.leresolver.acme.storage=/acme.json
- --certificatesresolvers.leresolver.acme.httpChallenge.entryPoint=web
ports:
- "80:80"
- "443:443"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./acme.json:/acme.json"
labels:
# Dashboard
- "traefik.http.routers.traefik.rule=Host(`traefik.fr`)"
- "traefik.http.routers.traefik.service=api@internal"
- "traefik.http.routers.traefik.tls.certresolver=leresolver"
- "traefik.http.routers.traefik.entrypoints=websecure"
- "traefik.http.routers.traefik.middlewares=authtraefik"
- "traefik.http.middlewares.authtraefik.basicauth.users=user:$$apr1$$q8eZFHjF$$Fvmkk//V6Btlaf2i/ju5n/" # user/password
# 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"
my-app:
image: containous/whoami
labels:
- "traefik.http.routers.my-app.rule=Host(`whoami.fr`)"
- "traefik.http.routers.my-app.middlewares=auth"
- "traefik.http.routers.my-app.entrypoints=websecure"
- "traefik.http.routers.my-app.tls=true"
- "traefik.http.routers.my-app.tls.certresolver=leresolver"
- "traefik.http.middlewares.auth.basicauth.users=user:$$apr1$$q8eZFHjF$$Fvmkk//V6Btlaf2i/ju5n/" # user/password
my-tcp-app:
image: containous/whoamitcp
labels:
- "traefik.tcp.routers.my-tcp-app.rule=HostSNI(`whoamitcp.fr`)"
- "traefik.tcp.routers.my-tcp-app.tls.passthrough=true"
- "traefik.tcp.routers.my-tcp-app.tls=true"
- "traefik.tcp.routers.my-tcp-app.tls.certresolver=leresolver"
- "traefik.tcp.routers.my-tcp-app.entrypoints=autre"
- "traefik.tcp.services.my-tcp-app.loadbalancer.server.port=8080"
I've downloaded packet sender to send tcp paquets to my server. And I receive "unable to connect".
In my dashboard, everything is ok.
What I suppose to get back on my screen if TCP paquet success ?
My config is ok ?
Thanks for your help !