Hey everyone !
I currently have an issue configuring a use case.
I have two devices on my network, all requests going to my first device.
And I would like to let some of the requests go trough and to my second device.
Let imagine we have the first one having the ip 10.0.0.10 and the second 10.0.0.20
The first have a docker-compose initializing a traefik and some services with labels. The point is to add a backend for redirecting to 10.0.0.20.
I tried the following but it doesn't work :
version: "3.4"
services:
reverse-proxy:
image: traefik:1.7
env_file:
- .env
command: --api --docker --acme.email="${ACME_EMAIL}"
container_name: traefik
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/etc/traefik/traefik.toml
- ./acme.json:/acme.json
labels:
- traefik.frontend.rule=Host:${TRAEFIK_DASHBOARD_HOST}
- traefik.port=8080
networks:
- proxy
expose:
- 8080
ports:
- 80:80
- 443:443
restart: unless-stopped
vscode:
image: linuxserver/code-server
container_name: vscode
env_file: .env
environment:
PUID: ${PUID}
PGID: ${PGID}
TZ: ${TIMEZONE}
PASSWORD: ${PASSWORD}
SUDO_PASSWORD: ${PASSWORD}
labels:
- traefik.backend=vscode
- traefik.frontend.rule=Host:${VSCODE_HOST}
- traefik.frontend.auth.basic=${HTACCESS}
- traefik.docker.network=proxy
- traefik.port=8443
volumes:
- ${VSCODE_CONFIG}:/config
- ${PROJECT_DIR}:/projects
ports:
- "8443"
networks:
- proxy
restart: unless-stopped
networks:
proxy:
external:
name: proxy
This part is working juste fine but then I add those lines in my toml :
[backends]
[backends.backend1]
[backends.backend1.servers.server1]
url = "http://10.0.0.20:80"
weight = 1
[frontends]
[frontends.frontend1]
backend = "backend1"
[frontends.frontend1.routes.route1]
rule = "Host:test.example.com"
And traefik doesn't add it when starting..
Could someone tell me how to do that and especially tell me if it is possible ?
Thanks !