Here is the case, I have two traefik instance, one is listen on 80 port, another listen on 810 port
When 80 port got a request where domain is aaa.domain.com
, I want to send all traffic to 810 port
Here is my code:
first 80 instance
docker compose config:
version: "3.9"
services:
traefik:
image: "traefik:v3.0.0-beta2"
network_mode: "host"
command:
- "--accesslog=true"
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.file.directory=/traefik_dynamic_configs"
- "--providers.file.watch=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./configs/traefik_dynamic_configs:/traefik_dynamic_configs" # <== Volume for dynamic conf file
restart: unless-stopped
dynamic config
tcp:
routers:
next_traefik_router:
entryPoints:
- web
rule: "HostSNI(`*`)"
service: next_traefik_service
services:
next_traefik_service:
loadBalancer:
servers:
- address: 127.0.0.1:810
second 810 instance
docker config:
version: "3.9"
services:
traefik:
image: "traefik:v3.0.0-beta2" #"traefik:v2.9.6"
container_name: "traefik"
command:
- "--accesslog=true"
# - "--accessLog.filePath=/tmp/traefik_log.txt"
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.file.directory=/traefik_dynamic_configs"
- "--providers.file.watch=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.smtp.address=:25"
ports:
- "810:80"
- "25:25"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./configs/traefik_dynamic_configs:/traefik_dynamic_configs" # <== Volume for dynamic conf file
restart: unless-stopped
dynamic config:
tcp:
routers:
smtp_router:
entryPoints:
- smtp
rule: "HostSNI(`*`)"
service: smtp_service
services:
smtp_service:
loadBalancer:
servers:
- address: weloveparty_account_auth_service:25
I do this simply because, some of my old project uses traefik, but I don't want to modify it, I just want to send some new sub-domain
request to the old traefik instance.
Some people say this is a 'transparent send' feature. Does traefik have it or not?